data.table
Replacing NAs with latest non-NA value
In a data.frame (or data.table), I would like to "fill forward" NAs with the closest previous non-NA value. A simple example, using vectors (instead of a data.frame) 开发者_开发百科is the fo[详细]
2023-04-12 04:44 分类:问答Using pandas, how do I subsample a large DataFrame by group in an efficient manner?
I am trying to subsample rows of a DataFrame according to a grouping.Here is an example.Say I define the following data:[详细]
2023-04-07 22:45 分类:问答Combining split() and cumsum()
I am trying to produce stats for cumulative goals by season by a particular soccer player. I have used the cut function to obtain the season from the game dates. I have data which corresponds to this[详细]
2023-04-05 04:14 分类:问答R: Tabulations and insertions with data.table
I am trying to take a very large set of records with multiple indices, calculate an aggregate statistic on groups determined by a subset of the indices, and then insert that into every row in开发者_Py[详细]
2023-04-04 01:44 分类:问答Problem with data.table ifelse behavior
I am trying to calculate a simple ratio using data.table. Different files have different tmax values, so that is why I need ifelse. When I debug this, the dt looks good. The tmaxValue is a single valu[详细]
2023-04-01 07:30 分类:问答Fastest way to replace NAs in a large data.table
I have a large data.table, with many missing values scattered throughout its ~200k rows and 200 columns.I would like to re code those NA values to zeros as efficiently as possible.[详细]
2023-03-31 19:22 分类:问答How to do a basic left outer join with data.table in R?
I have a data.table of a and b that I\'ve partitioned into below wit开发者_StackOverflowh b < .5 and above with b > .5:[详细]
2023-03-28 11:42 分类:问答Using Dates with the data.table package
I recently discovered the data.table package and was now wondering whether or not I should replace some of my plyr-code. To summarize, I really like plyr and I basically achieved everything I wanted.[详细]
2023-03-26 08:17 分类:问答Proper/fastest way to reshape a data.table
I have a data table in R: library(data.table) set.seed(1234) DT <- data.table(x=rep(c(1,2,3),each=4), y=c(\"A\",\"B\"), v=sample(1:100,12))[详细]
2023-03-24 03:29 分类:问答How to avoid printing a package's author message? [duplicate]
This question already has answers here: 开发者_开发知识库Closed 11 years ago. Possible Duplicate:[详细]
2023-03-14 11:28 分类:问答