I would like a record of coffee dispenses a line chart from the beginning of the recording to the end. I would like to determine the beverages purchased per day. The respective number per day should be displayed over the complete time span.
After I read in the data set I had first problems with the Date/Time format.
I suspect that I do not bring them into the correct format.
Then I tried to calculate the coffee consumption per day. Then I found out that with my formula it always uses the year 2020, although it goes back to 2019.
So my plot looks quite funny, and there is no year to be found.
Can someone please help me?
Thanks a lot!
Link to the Dataset: https://github.com/Skruff80/Getting-started/blob/master/ProductList.csv
coffeedata <- fread("C:/temp/ProductList.csv")
str(coffeedata)
head(coffeedata)
coffeedata$Date = as.Date(coffeedata$Date, "%d.%m.%y")
head(coffeedata)
countcoffee <- function(timeStamps) {
Dates <- as.Date(strftime(coffeedata$Date, "%Y-%m-%d"))
allDates <- seq(from = min(Dates), to = max(Dates), by = "day")
coffee.count <- sapply(allDates, FUN = function(X) sum(Dates == X))
data.frame(day = allDates, coffee.count = coffee.count)}
daylicounter = countcoffee(df$message.date)
lines(daylicounter)
The plot should look something like the picture in the link.
https://github.com/Skruff80/Getting-started/blob/master/example.png
Appreciate your help.
Use ggplot2
You can do that by using the ggplot2 library, like in this code:
library(ggplot2)
ggplot(daylicounter, aes(day, coffee.count)) +
geom_line(color = "orange", size = 1) +
scale_x_date(breaks = "1 month", date_labels = "%Y-%m-%d")
This is the output graph:
Edit
If you need a custom break vector, you can use a code like this:
library(ggplot2)
break.vec <- seq(from = min(daylicounter$day), to = max(daylicounter$day),
by = "month")
ggplot(daylicounter, aes(day, coffee.count)) +
geom_line(color = "orange", size = 1) +
scale_x_date(breaks = break.vec, date_labels = "%d-%m-%Y")
Hope this help.
Could fix the error with the X-axis. As I already suspected, reformatting the date was the error.
I had used
%y
instead of
%Y
coffeedata$Date = as.Date(coffeedata$Date, "%d.%m.%Y")
Related
I have data that looks as follows:
Date Time_finished
4/3/2020 16:30:21
4/6/2020 16:43:29
4/7/2020 16:28:47
4/8/2020 16:30:38
4/9/2020 16:50:01
I would like to plot a line chart showing date across the x axis and then the time finished on the y axis, to show a time series graph. For some reason this does not seem to be working, the Date is saved as Date but time as a factor, does this also need to be a date?
I have tried normal plot but having no luck.
Thanks
Like this?
df <- tibble::tribble(
~Date, ~Time_finished,
"4/3/2020", "16:30:21",
"4/6/2020", "16:43:29",
"4/7/2020", "16:28:47",
"4/8/2020", "16:30:38",
"4/9/2020", "16:50:01"
)
library(tidyverse)
df %>%
mutate(Date = as.POSIXct(Date, format = "%m/%d/%y"),
Time_finished = as.POSIXct(Time_finished, format = "%H:%M:%S")) %>%
ggplot(aes(x = Date, y = Time_finished, group = 1)) +
geom_line() + scale_y_datetime(breaks = date_breaks("10 min"),
minor_breaks = date_breaks("2 min"),
labels = date_format("%Hh %Mm %Ss"))
I am having a problem with Date in R, in my dataset the format of my date is like this: 15.01.2018, but in my X, I see [0, 50, 100, ...] instead of date.
This is my simple program to have a line chart that X axis should be my date (that is 365 days), could you please let me know what is my mistake?
library(ggplot2)
v <- MyDataSet$ACTUAL/100000
t <- MyDataSet$FORECAST/100000
mese <- as.Date(MyDataSet$CalDay , format = "%m.%d.%Y", frequency = 6)
plot(v,type = "l",col = "red", xlab = mese, ylab = "Actual in Milion",
main = "Actual Forecst")
lines(t, type = "l", col = "blue")
I was excepting to see all days, or at least group them by month... But do not know how can I do it
P.S. This is my dataset, It an excel file with rows like below, I upload it as a DataModel in SAP Analytics and read it.
Many thanks
I am not sure what kind of output you expect. The plot below is forecast by date and the color is the actual.
library(ggplot2)
library(lubridate)
library(scales)
# convert Calday to proper date formate using lubridate
df$Calday <- dmy(df$Calday)
base <- ggplot(df, aes(x=Calday, y = FORECAST/100000, color=Actual/100000))
base + geom_line() + scale_x_date(labels = date_format("%d-%m"))
Output
Data
df <- data.frame(Calday = c("08.01.2018", "15.01.2018", "22.01.2018", "02.01.2018", "09.01.2018", "16.01.2018"),
Actual = c(2262, 2490, 1930, 9898, 860, 440), FORECAST = c(72485, 69961, 36368, 22618, 18703,22568 ))
I have an extensive set of levels of my interest variable (over a year of collection). I would like to plot these levels (there are 3 levels) in coordinates X (date of the year- the day of the year) and Y (time of day- hour).
I am encountering difficulties due to the collection period and also to put a legend with each level.
I would be grateful if anyone could indicate how to compose this graph
My matrix data:
Hour;28/jun;29/jun;30/jun;01/jul;02/jul;03/jul;04/jul;05/jul;06/jul;07/jul;08/jul;09/jul;10/jul;11/jul;12/jul;13/jul;14/jul;15/jul;16/jul;17/jul;18/jul;19/jul;20/jul;21/jul;22/jul;23/jul;24/jul;25/jul;26/jul;27/jul;28/jul;29/jul;30/jul;31/jul;01/ago;02/ago;03/ago;04/ago;05/ago;06/ago;07/ago;08/ago;09/ago;10/ago;11/ago;12/ago;13/ago;14/ago;15/ago;16/ago;17/ago;18/ago;19/ago;20/ago;21/ago;22/ago;23/ago;24/ago;25/ago;26/ago;27/ago;28/ago;29/ago;30/ago;31/ago;01/set;02/set;03/set;04/set;05/set;06/set;07/set;08/set;09/set;10/set;11/set;12/set;13/set;14/set;15/set;16/set;17/set;18/set;19/set;20/set;21/set;22/set;23/set;24/set;25/set;26/set;27/set;28/set;29/set;30/set;01/out;02/out;03/out;04/out;05/out;06/out;07/out;08/out;09/out;10/out;11/out;12/out;13/out;14/out;15/out;16/out;17/out;18/out;19/out;20/out;21/out;22/out;23/out;24/out;25/out;26/out;27/out;28/out;29/out;30/out;31/out;01/nov;02/nov;03/nov;04/nov;05/nov;06/nov;07/nov;08/nov;09/nov;10/nov;11/nov;12/nov;13/nov;14/nov;15/nov;16/nov;17/nov;18/nov;19/nov;20/nov;21/nov;22/nov;23/nov;24/nov;25/nov;26/nov;27/nov;28/nov;29/nov;30/nov;01/dez;02/dez;03/dez;04/dez;05/dez;06/dez;07/dez;08/dez;09/dez;10/dez;11/dez;12/dez;13/dez;14/dez;15/dez;16/dez;17/dez;18/dez;19/dez;20/dez;21/dez;22/dez;23/dez;24/dez;25/dez;26/dez;27/dez;28/dez;29/dez;30/dez;31/dez
0;NA;3;3;3;3;3;3;0;0;0;0;0;3;0;0;3;0;0;3;0;3;3;3;3;3;3;0;0;3;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3;0;0;0;0;3;3;3;3;3;3;3;3;0;0;5;5;5;3;5;3;3;3;3;3;5;5;3;3;3;3;5;0;3;3;0;3;3;3;3;3;3;3;3;3;0;0;3;3;3;3;3;0;0;0;3;3;3;0;0;3;3;0;3;3;3;3;0;3;3;3;3;0;0;3;3;0;3;3;3;3;3;3;0;0;3;0;0;0;3;3;3;3;3;3;0;3;3;0;0;3;3;3;3;0;0;0;3;3;3;3;3;0;3;3;3;0;0;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;0;0;3;0;3;3;3;3
23.5;3;3;3;3;3;3;0;0;0;0;0;3;0;0;3;0;0;3;3;3;3;3;3;3;0;3;0;3;3;0;3;3;3;0;0;3;0;3;3;0;0;0;3;3;3;3;3;0;0;0;0;3;5;5;0;3;3;5;3;0;0;3;5;5;3;5;3;3;3;3;3;0;5;3;3;3;3;5;0;3;3;0;3;3;3;3;3;3;3;3;3;0;0;3;3;3;3;3;0;0;0;3;3;3;3;0;3;3;0;3;3;3;3;0;3;3;3;3;0;0;3;3;0;3;3;3;3;3;3;0;0;3;0;0;0;3;3;3;3;3;3;0;3;3;0;0;3;3;3;3;3;0;0;3;3;3;3;3;0;3;3;3;0;0;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;0;0;3;0;3;3;3;3
I tried it: http://www.r-graph-gallery.com/27-levelplot-with-lattice/
dados=as.matrix(read.table("1_3.txt", header=T, sep = ";"))
head(dados,5)
heatmap(dados, Colv = NA, Rowv = (NA), scale="none", xlab = "Date", ylab = "Hour")
But the information on the x- and y-axis becomes unclear and no caption appears
And...https://www.r-graph-gallery.com/133-demineur-dataart/
dados <- read.table("1_3.txt", header=T, sep = ";")
y <- dados$Hour
x <- dados[,-1]
par(mar=c(0,0,0,0))
data <- expand.grid(X=x, Y=y)
plot(data[,1],data[,2],xaxt="n",yaxt="n", xlab="", ylab="", bty="n", mar=c(0,0,0,0), pch=20,cex=3,col=rgb(0.2,0.2,0.4,sample(seq(0.2,1,0.001), 10000,replace=T)))
But "xlab" matched by multiple actual arguments
It was not very easy for me to copy your data to play around with, but I managed. Please consider using the output of dput(your_data) in future questions.
Since somebody tagged this question with ggplot2, I'm going to assume you want to achieve this heatmap of your matrix in ggplot. Assuming dados is your matrix, we'll first melt it from a wide format to a long format:
df <- reshape2::melt(dados, id.vars = "Hour")
Then the next thing to do would be to use ggplot with a raster geom:
ggplot(df, aes(x = variable, y = Hour, fill = value)) +
geom_raster()
Which gave me the following plot:
As is clear to see, the x-axis is quite overcrowded. To fix this, we need to get your annotation of the date into a format that R understands. I'm not really good with dates in R, but you might try something like the following:
months <- substr(as.character(df$variable), 4, nchar(as.character(df$variable)))
months <- factor(months, levels = unique(months))
levels(months) <- 6:12
months <- as.numeric(as.character(months))
days <- substr(as.character(df$variable), 1, 2)
df$date <- as.Date(paste0(months, "-", days), format = "%m-%d")
And now you can plot with the date as the x axis:
ggplot(df, aes(x = date, y = Hour, fill = value)) +
geom_raster()
And that should be a decent heatmap to get you started.
It worked very well: I just renamed my columns of dates in the original data. I put the name of each month in the first hour of the first day. The rest I left out.
df <- reshape2::melt(dados, id.vars = "Hour")
f1 <- ggplot(df, aes(x = variable, y = Hour, fill = value)) +
geom_raster()+
theme(legend.title=element_blank()) +
theme(text=element_text(family="Times New Roman", size=12))
f1
f1 + scale_x_discrete(breaks=c("Jul","Aug", "Sep", "Oct", "Nov", "Dec"))
I want to creat a time vector which starts at 0:05:00 A.M and ends at 0:00:00 A.M the next day.The interval between each time spot is 5 minutes;
Then I want a y-t line plot with qplot().
Here is my R code:
t<-strptime('0:05:00','%H:%M:%S')+(0:287)*300
y<-rnorm(288,5,1)
qplot(t,y,geom = 'line')
the outcome is like this:
As you can see, the 't' is added with system date 'Aug 05'.What I want is 'hour : minute' only.
What should I do with my code?
Here is a solution using ggplot2 and POSIX formatting for dates which is easy to manipulate with ggplot:
df = data.frame(
t = seq(as.POSIXct("2016-01-01 05:00:00"), as.POSIXct("2016-01-02 00:00:00"), by = '5 min', tz = "Europe"),
y = rnorm(229,5,1))
ggplot(df, aes(t, y)) + geom_line() +
scale_x_datetime(labels = date_format('%H:%M', tz = "GMT"), breaks = date_breaks('2 hours'))
One suggestion is to manually set the tick labels. Note that in the snippet below, I amended slightly your code for t and y, so that they start and end at 0:00:00 (instead of starting at 0:05:00).
t <- strptime('0:00:00','%H:%M:%S')+(0:288)*300
y <- c(NA, rnorm(288,5,1))
tlabs <- format(t, "%H:%M")
breaks <- seq(1, 289, 72)
qplot(as.numeric(t),y,geom = 'line') +
scale_x_continuous(labels=tlabs[breaks], breaks=as.numeric(t)[breaks]) +
xlab("t")
Output:
I am trying to make a heatmap of several years of daily averages of salinity in an estuary in R.
I would like the format to include month on the x-axis and year on the y-axis, so each Jan 1st directly above another Jan. 1st. In other words, NOT like a typical annual calendar style (not like this: http://www.r-bloggers.com/ggplot2-time-series-heatmaps/).
So far I have only been able to plot by the day of the year using:
{r}
d <- read.xlsx('GC salinity transposed.xlsx', sheetName = "vert-3", header = TRUE, stringsAsFactors = FALSE, colClasses = c("integer", "integer", "numeric"), endRow = 2254)
{r}
ggplot(d, aes(x = Day.Number, y = Year)) + geom_tile(aes(fill = Salinity)) + scale_fill_gradient(name = 'Mean Daily Salinity', low = 'white', high = 'blue') + theme(axis.title.y = element_blank())
And get this:
heat map not quite right
Could someone please tell me a better way to do this - a way that would include month, rather than day of the year along the x-axis? Thank you. New to R.
The lubridate package comes in handy for stuff like this. Does this code do what you want? I'm assuming you only have one salinity reading per month and there's no need to average across multiple values in the same month.
library(lubridate)
library(ggplot2)
# Define some data
df <- data.frame(date = seq.Date(from = as.Date("2015-01-01"), by = 1, length.out = 400),
salinity = runif(400, min=5, max=7))
# Create fields for plotting
df$day <- paste0(ifelse(month(df$date)<10,"0",""),
month(df$date),
"-",
ifelse(day(df$date)<10,"0",""),
day(df$date))
df$month <- paste0(ifelse(month(df$date)<10,"0",""),
month(df$date))
df$year <- year(df$date)
library(lubridate)
library(ggplot2)
# Define some data
df <- data.frame(date = seq.Date(from = as.Date("2015-01-01"), by = 1, length.out = 400),
salinity = runif(400, min=5, max=7))
# Create fields for plotting
df$day <- paste0(ifelse(month(df$date)<10,"0",""),
month(df$date),
"-",
ifelse(day(df$date)<10,"0",""),
day(df$date))
df$month <- paste0(ifelse(month(df$date)<10,"0",""),
month(df$date))
df$year <- year(df$date)
#Plot results by month
ggplot(data=df) +
geom_tile(aes(x = month, y = year, fill = salinity)) +
scale_y_continuous(breaks = c(2015,2016))
#Plot results by day
ggplot(data=df) +
geom_tile(aes(x = day, y = year, fill = salinity)) +
scale_y_continuous(breaks = c(2015,2016))
Results by month:
Results by day (do you really want this? It's very hard to read with 366 x-axis values):