Split from: How to calculate daily average of hourly data and for different variables at the same time
I have another problem here. Reprex example can be found below.
library(data.table)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:data.table':
#>
#> between, first, last
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(readr)
library(ggplot2)
library(tictoc)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:data.table':
#>
#> hour, isoweek, mday, minute, month, quarter, second, wday,
#> week, yday, year
#> The following object is masked from 'package:base':
#>
#> date
library(gtools)
library(stringi)
library(tidyverse)
DHW_DayStatsHotwater %>% select(Address,Month_number,Day_number,DayAvg)
#> Error in eval(lhs, parent, parent): object 'DHW_DayStatsHotwater' not found
I want to arrange my Day_number column and Month_number column in ascending order. However, my address column should remain as it is, as you can see the Address column is already in ascending order. However the DayAvg would ofcourse change its order.
I have used the following but it didn't work out in my case.
DHW_DayStatsHotwater%>%arrange(Day_number,Month_number)
Please note that all my columns are in numeric form except the Address column which is character.