Displaying 9 results from an estimated 9 matches for "setkeyv".
Did you mean:
setkey
2016 Apr 20
1
Use multiple cores on Linux
...istoric/giss_temp_hist.csv")
humid_hist <- read.csv("/work/sd00815/giss_historic/giss_hum_hist.csv")
#
temp_hist <- as.data.table(temp_hist)
humid_hist <- as.data.table(humid_hist)
#
# Merge
mykey<- c("FIPS", "year","month", "week")
setkeyv(temp_hist, mykey)
setkeyv(humid_hist, mykey)
#
hist<- merge(temp_hist, humid_hist, by=mykey)
#
hist$X.x <- NULL
hist$X.y <- NULL
#
# Max
hist_max <- hist
hist_max$FIPS <- hist_max$year <- hist_max$month <- hist_max$tmin <-
hist_max$tmean <- hist_max$hmin <- hist_max$hm...
2012 May 25
1
Multiple rms summary plots in a single device
...seg <- subset(tData,
groups == segment) logic), but I included the data.table logic in case
it may be having some influence. Thank you!
Mike
tData <- data.frame(groups=as.factor(1:8), low=as.factor(1:4)
,high=as.factor(seq(100, 400, 100)), rand=runif(400))
tData <- data.table(tData)
setkeyv(tData, 'groups')
dd <- datadist(tData)
options(datadist = 'dd')
doSumPlot <- function(segment){
seg <<- tData[groups == segment,]
plot(summary(rand ~
+ low
+ high
,data = seg
), main=paste('Group:', segment))
}
for(i in 1:length(levels(tData$grou...
2020 Mar 22
3
Tasa variación diaria COVID-19
...t; library(anytime)
>
> df <-datos
>
> df[, fec:=anytime(fec)]
Error in `:=`(fec, anytime(fec)) :
Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are
defined for use in j, once only and in particular ways. See help(":=").
> setkey(df,com,fec)
Error in setkeyv(x, cols, verbose = verbose, physical = physical) :
x is not a data.table
>
> # newc: son los nuevos casos
> df[, newc:=ct - shift(ct), by=.(com)]
Error in `[.data.frame`(df, , `:=`(newc, ct - shift(ct)), by = .(com)) :
unused argument (by = .(com))
>
> # tasa: es la tasa de cambi...
2017 Jan 06
4
que tal comunidad, una pregunta del paquete data.table
si se tiene un data.table (DT), supongamos de 100 filas por 3 columnas
de datos numericos, como puedo hacer para obtener el correspondiente
valor de la columna 1 si busco, por ejemplo, el maximo de la columna 2
agrupado por la columna 3 ?
para buscar el maximo de la columna 2 escribo.
DT[ , max(c2), by=c3 ]
muchas gracias,
saludos, eric.
--
Forest Engineer
Master in Environmental and
2020 Mar 23
2
Tasa variación diaria COVID-19
...gt; df[, fec:=anytime(fec)]
> > Error in `:=`(fec, anytime(fec)) :
> > Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are
> > defined for use in j, once only and in particular ways. See help(":=").
> > > setkey(df,com,fec)
> > Error in setkeyv(x, cols, verbose = verbose, physical = physical) :
> > x is not a data.table
> > >
> > > # newc: son los nuevos casos
> > > df[, newc:=ct - shift(ct), by=.(com)]
> > Error in `[.data.frame`(df, , `:=`(newc, ct - shift(ct)), by = .(com)) :
> > unused...
2020 Mar 25
2
Tasa variación diaria COVID-19
...`(fec, anytime(fec)) :
> > > > Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...)
> are
> > > > defined for use in j, once only and in particular ways. See
> help(":=").
> > > > > setkey(df,com,fec)
> > > > Error in setkeyv(x, cols, verbose = verbose, physical = physical) :
> > > > x is not a data.table
> > > > >
> > > > > # newc: son los nuevos casos
> > > > > df[, newc:=ct - shift(ct), by=.(com)]
> > > > Error in `[.data.frame`(df, , `:=`(newc, c...
2014 Mar 15
0
allocation error and high CPU usage from kworker and migration: memory fragmentation?
...) := list(floor_date(week_end, unit=timevar),
year(week_end))]
move <- merge(move, upc, by=c('upc')) # adds is_PL column, a boolean
move <- merge(move, parent, by=c('store', 'year') # adds parent
column, an integer
setkeyv(move, by)
# this reduces move to a data.table with at most 6000 rows, but
always 4 columns
move <- move[, list(revenue=sum(price*units),
revenue_PL=sum(price*units*is_PL)),
keyby=by]
move[, category := gsub(search, replace, filename)]
return(move)
}
--
Jam...
2012 Sep 14
3
aggregate() runs out of memory
I have a large data.frame Z (2,424,185,944 bytes, 10,256,441 rows, 17 columns).
I want to get the result of
table(aggregate(Z$V1, FUN = length, by = list(id=Z$V2))$x)
alas, aggregate has been running for ~30 minute, RSS is 14G, VIRT is
24.3G, and no end in sight.
both V1 and V2 are characters (not factors).
Is there anything I could do to speed this up?
Thanks.
--
Sam Steingold
2020 Mar 21
9
Tasa variación diaria COVID-19
Hola:
Tengo los datos diarios del número de casos de coronavirus por comunidades
autónomas y quiero calcular el número diario de nuevos casos y la tasa
diaria de variación del número de casos y no se como hacerlo en R.
*fecha*
*comunidad*
*poblacion*
*casos_totales*
04/03/2020
Andalucía
8414240
13
05/03/2020
Andalucía
8414240
12
06/03/2020
Andalucía
8414240
21
04/03/2020
Aragón