0

I have data that spans over a week roughly that looks like this:

  Date       Time     Axis1 Axis2 Axis3 VM    Standing Stepping Cycling
  <chr>      <chr>    <chr> <chr> <chr> <chr> <chr>    <chr>      <dbl>
1 2022-05-06 14:34:00 0     0     0     0     0        0              0
2 2022-05-06 14:34:01 0     0     0     0     0        0              0
3 2022-05-06 14:34:02 0     0     0     0     0        0              0
4 2022-05-06 14:34:03 0     0     0     0     0        0              0
5 2022-05-06 14:34:04 0     0     0     0     0        0              0
6 2022-05-06 14:34:05 0     0     0     0     0        0              0
# … with 1 more variable: New_Sitting <dbl>

And I'm trying to sum every column per day, this is what I have so far

split(data1, f = data1$Date)
Sum_day <- colSums()

but it gives me an error of:

Error in colSums(2022 - 5 - 6) : 
'x' must be an array of at least two dimensions

So basically I'm not sure how to use the tibbles that are returned from the split() function, maybe I should be using another function to do what I want?

0 Answers0