Hi all
I have a csv file with samples and there result time. This file is 27000 rows big and the result time is of one day (0:00:00 untill 23:59:59).
I want to make a histogram that shows the distribution of the amount of samples over time. That it is visible that eg: around 14u, the most of the samples are done.
I need to have a file that says:
[0-1h] = 278 samples
[1-2h] = 28 samples
...
[14-15h] = 7096 samples
...
[23-0h] = 55 samples
This info can I place into a histogram.
How can I come from a file that is listing all the samples and there (result)time to a file as above? I need to select the samples in each hour and count them and list them in a new data.frame that I can use for the histogram.
I already read a lot online and tried a lot (a couples of hours passed by), one of the things that I did is the following:
#Calculate the amount of FirstScan samples each hour by using the While loop and a counter:
install.packages("lubridate",repos = "http://cran.us.r-project.org")
DataHourMinutesSeconds <- df1 %>%
separate(FirstScanTime, sep = ":", into = c("Hours", "Minutes", "Seconds")) %>%
mutate_at(c("Hours", "Minutes", "Seconds"), as.numeric)
counter=0
df3 = data.frame()
while (counter<24) {
sum <- count(DataHourMinutesSeconds,
filter(Hours == counter))
df3[nrow(df3) + 1,] = c(counter, sum)
counter = counter+1
}
Thank in advance!