Displaying 6 results from an estimated 6 matches for "dttm".
Did you mean:
dtm
2012 May 09
2
Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:
..., "2011-06-16", "2011-06-17", "2011-06-20",
"2011-06-21", "2011-06-22", "2011-06-23", "2011-06-24", "2011-06-27",
"2011-06-28", "2011-06-29", "2011-06-30"), class = "factor"),
DTTM = structure(list(sec = c(7, 3, 3, 3, 3, 4), min = c(7L,
15L, 15L, 15L, 15L, 15L), hour = c(9L, 9L, 9L, 9L, 9L, 9L
), mday = c(3L, 3L, 3L, 3L, 3L, 3L), mon = c(0L, 0L, 0L,
0L, 0L, 0L), year = c(111L, 111L, 111L, 111L, 111L, 111L),
wday = c(1L, 1L, 1L, 1L, 1L, 1L), yday = c(2L, 2L...
2012 Sep 09
1
Sum of column from another df based of row values of df1
...;15:23:42", "15:22:30",
"15:24:13", "15:22:07", "15:22:27"), PRICE = c(107, 102.05, 101.3,
101.5, 101.2, 101.2), QUANT = c(1850L, 2000L, 2000L, 1700L, 2000L,
2000L), DATE = structure(c(14977, 14977, 14977, 14977, 14977,
14977), class = "Date"), DTTM = structure(c(1294044516, 1294048422,
1294048350, 1294048453, 1294048327, 1294048347), class = c("POSIXct",
"POSIXt"), tzone = ""), TTE = c(38, 38, 38, 38, 38, 38)), .Names = c("NAME",
"EXPDATE", "STRIKE", "TMSTMP", "PRICE&q...
2012 May 12
1
Query regarding date as argument in functions - and about sqldf
...54:17", "14:42:38", "14:09:04", "14:20:25",
"12:27:26", "11:59:36"), PRICE = c(22, 23, 23, 23, 23, 23.2
), DATE = structure(c(14977, 14977, 14977, 14977, 14977,
14977), class = "Date"), TTE = c(24, 24, 24, 24, 24, 24),
DTTM = structure(c(1294046657, 1294045958, 1294043944, 1294044625,
1294037846, 1294036176), class = c("POSIXct", "POSIXt")),
SPOT = c(295, 294.5, 294.8, 293.85, 294.7, 294.55), MONEYNESS =
c(1.05357142857143,
1.05178571428571, 1.05285714285714, 1.04946428571429, 1.0525,...
2017 Nov 11
0
weighted average grouped by variables
...ehicles))
> gives you averages
>
The result of this calculation is:
car light_duty heavy_duty motorcycle
36.54109 36.54109 36.54109 36.54109
But this doesn't give the same result as the dplyr method which is:
date_time type vel
<dttm> <fctr> <dbl>
1 2017-10-17 13:00:00 car 36.39029
2 2017-10-17 13:00:00 light_duty 38.56522
3 2017-10-17 13:00:00 heavy_duty 37.53333
4 2017-10-17 13:00:00 motorcycle 36.08696
The base R way of getting the result should be modified slightly into
sapply(split(mydf, mydf...
2017 Nov 20
2
mensaje de error al usar libreria tibbletime
Hola A todos.
Aún no he podido encontrar la causa de porqué la libraría tibbletime, al transformar la tabla a AS_TBL_TIME ME ARROJA EL SIGUIENTE EL SIGUIENTE MENSAJE
Error: assert_that: assertion must return a logical value
Si alguien ha tenido ese mismo problema, solicito ayuda al foro.
El seguimiento de la transformación es el siguiente;
library(tibbletime)
2017 Nov 09
2
weighted average grouped by variables
Hi
Thanks for working example.
you could use split/ lapply approach, however it is probably not much better than dplyr method.
sapply(split(mydf, mydf$type), function(speed, n_vehicles) sum(mydf$speed*mydf$n_vehicles)/sum(mydf$n_vehicles))
gives you averages
aggregate(mydf$n_vehicles, list(mydf$type), sum)$x
gives you sums
Cheers
Petr
> -----Original Message-----
> From: R-help