-2

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;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0;3;0;3;3;3;3;3;3;0;0;3;0;3;3;0;0;0;3;3;3;3;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

Marcel
  • 147
  • 4
  • As another user has mentioned please use `dput(your_data)` in the future and you'll get more responses. From reading your question I would recommend you look up `stat_density_2d()` which is great at producing heat maps. – tom91 May 01 '19 at 10:42

2 Answers2

1

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:

enter image description here

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()

enter image description here

And that should be a decent heatmap to get you started.

teunbrand
  • 33,645
  • 4
  • 37
  • 63
  • Thank you very much for your help and your tips. I am a beginner in R and I do not speak English very well, so it is very important to receive these suggestions. Thank you very much! – Marcel May 02 '19 at 14:35
  • The code to generate the second chart is not working. The following error appears: Error in seq.int (0, to0 - from, by): 'to' must be a finite number In addition: Warning messages: 1: In min (x): no non-missing arguments to min; returning Inf 2: In max (x): in non-missing arguments to max; returning -Inf 3: In min (diff (sort (x))): no non-missing arguments to min; returning Inf Could you help again? – Marcel May 02 '19 at 16:53
  • After what function does that error appear? Can you give me a `head()` of what you are supplying to that function? – teunbrand May 02 '19 at 17:40
  • After this code: `ggplot(df, aes(x = date, y = Hour, fill = value)) + geom_raster()` The error message: `Error in seq.int(0, to0 - from, by) : 'to' must be a finite number` `In addition: Warning messages:` `1: In min(x) : no non-missing arguments to min; returning Inf` `2: In max(x) : no non-missing arguments to max; returning -Inf` `3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf` – Marcel May 02 '19 at 19:23
  • I do not know if my interpretation is correct but apparently the X-axis information has not been filled, with theses comands: `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")` – Marcel May 02 '19 at 19:27
  • Does you dataset maybe contain more months/dates than the one you posted? Because then you would have to adjust this piece of code: `levels(months) <- 6:12` to reflect the number of months you have. Any way of formatting the `df$variable` to a proper date format would do the trick, there are other ways besides my possibly inefficient code. – teunbrand May 02 '19 at 19:55
  • My dataset starts on June 28th and ends on December 31st. Considering the month of June (although 3 days, only) I have 7 months. When I change the code to: `levels(months) <- 5:12` I still do not have the efficiency in the code – Marcel May 03 '19 at 17:50
  • I'm sorry I don't know where exactly the code breaks down. Have a look at `?as.Date()`, try to figure out a way to get your months in numerical format and days from the column names and format it to a date. You could have a look at the lubridate package. – teunbrand May 03 '19 at 18:03
0

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")) 

enter image description here

Marcel
  • 147
  • 4