Let's say I have a data table library(data.table) DT <- data.table(x=c(1,1,0,0),y=c(0,1,2,3)) column_name <- "x" x y 1: 1 0 2: 1 1 3: 0 2 4: 0 3 And
I have a pretty big amount of data in a data table. I would like to delete a number of rows if there is a certain value in a cell. Below is an excerpt from my d
How do I use variable column names on the RHS of := operations? For example, given this data.table "dt", I'd like to create two new columns, "first_y" and "firs
Here is my dataset: data <- read.table(header = TRUE, text = " group index group_index x y z a 1 a1 12 13 14 a 2 a2
hello im trying to extract some id with a group and Date in range > d1 id group Date 1: 1 A 2017-07-02 2: 2 A 2017-07-04 3: 3 A
I am trying to download a list using R with the following code: name <- paste0("https://www.sec.gov/Archives/edgar/full-index/2016/QTR1/master.idx") master
I have two map/data.tables. One consists of key-values and another one just of some keys. I want to map the values from the first map to the keys of the second.
I have data frame of 24525 rows and 22 columns. Last column is the ID column, other are numeric. Number of unique IDs is 18414 and some IDs are repeated more th
My df looks like this: Id Task Type Freq 3 1 A 2 3 1 B 3 3 2 A 3 3 2 B 0 4 1 A 3 4 1
Why does this code not work? How can I benchmark these to expressions? library(data.table) library(dplyr) dt <- as.data.table(mtcars) (lb <- bench::mar