plyr
Get and process entire row in ddply in a function
It\'s easy to grab one or more in ddply to process, but is there a way to grab the entire current row and pass that onto a function? Or to grab a set of columns determined at runtime?[详细]
2023-02-18 05:50 分类:问答aaply fails on a vector
I am trying to understand how to use the excellent plyr p开发者_如何转开发ackage\'s commands on a vector (in my case, of strings). I suppose I\'d want to use aaply, but it fails, asking for a margin.[详细]
2023-02-17 02:13 分类:问答Fastest Tall-Wide pivoting in R
I am dealing with a simple table of the form datevariablevalue 1970-01-01V10.434 1970-01-01V212.12 1970-01-01V3921.1[详细]
2023-02-17 00:34 分类:问答How to rewrite a "sapply" command to increase performance?
I have a data.frame named \"d\" of ~1,300,000 lines and 4 columns and another data.frame named \"gc\" of ~12,000 lines and 2 columns (but see the smaller example below).[详细]
2023-02-16 15:40 分类:问答How does one make summarise from plyr output wide rather than long
I love the ability of plyr to split a data frame into multiple data sets and then perform identical operations on each set. The best part is when it shows you the result as a neat compact well labeled[详细]
2023-02-15 18:06 分类:问答Is there a R function that applies a function to each pair of columns?
I often need to apply a function to each pair of columns in a dataframe/matrix and return the results in a matrix. Now I always write a loop to do this. For instance, to make a matrix containing the p[详细]
2023-02-15 17:58 分类:问答R: using ddply to apply functions to subsets of data
I\'m trying to use the ddply method to take a dataframe with various info about 3000 movies and then calculate the mean gross of each genre. I\'m new to R, and I\'ve read all the questions on here rel[详细]
2023-02-15 06:02 分类:问答Add indicator variable to long data frame for when the value increases from one year to the next
I have a long data frame with three columns fyear, tic, and dcvt (for fiscal year, ticker, and total convertible debt). There are about 18 fiscal years and a few thousand tickers. I would like to add[详细]
2023-02-14 01:35 分类:问答plyr application, creating a list of matrices each of which corresponds to a subset of the data
With some help, I figured out how to transform an edgelist, aka, an adjacency list into an adjacency matrix.I want to learn how to automate this for a large number of edgelists and then put the result[详细]
2023-02-13 02:49 分类:问答How can I generate by-group summary statistics if my grouping variable is a factor?
Suppose I wanted to get some summary statistics on the dataset mtcars (part of base R version 2.12.1).[详细]
2023-02-07 22:07 分类:问答