I need help with heatmaps, I am first timer and I usually have problems when coming to frequencies graphs.
I need to create a heatmap with date
on x
axis, and crepus
on y
axis. That is fine.
The variable I want for the color is the frequency of all species (speciesname
), which would be the total sum of all species of the variable nmb_individuals
, obviously by date
and crepus
value.
When trying it, I get a completely blank heatmap, though the scale looks good:
our_data %>%
ggplot(aes(date,crepus,fill=nmb_individuals)) + geom_tile()
Find a small portion of my dataset here:
our_data <- structure(list(speciesname = c("Wood Lark", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "bunting sp.",
"Robin", "Blackbird", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Chaffinch", "Chaffinch",
"Chaffinch", "Chaffinch", "Cirl Bunting", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Redwing",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Chaffinch",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Blackbird", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Redwing", "Redwing", "Redwing", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Raven", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Skylark", "Blackbird", "Blackbird", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Chaffinch", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Blackbird", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Blackbird", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Redwing", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Redwing", "Redwing", "Chaffinch", "Song Thrush",
"Dunnock", "Dunnock", "Dunnock", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Dunnock", "Song Thrush",
"Song Thrush", "Song Thrush", "Chaffinch", "Blackbird", "Song Thrush",
"Redwing", "Song Thrush", "Song Thrush", "Song Thrush", "Skylark",
"Skylark", "Song Thrush", "Song Thrush", "Song Thrush", "Redwing",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Chaffinch", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Redwing", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Blackbird", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Redwing",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Blackbird", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Dunnock", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Redwing", "Song Thrush", "Song Thrush",
"Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush", "Song Thrush",
"Song Thrush", "Redwing"), date = structure(c(18556, 18556, 18556,
18556, 18557, 18557, 18557, 18557, 18558, 18558, 18558, 18558,
18558, 18558, 18558, 18558, 18558, 18558, 18558, 18558, 18558,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18560, 18560,
18560, 18560, 18560, 18560, 18560, 18560, 18560, 18560, 18560,
18560, 18560, 18560, 18560, 18562, 18562, 18562, 18562, 18562,
18562, 18562, 18563, 18563, 18563, 18563, 18563, 18563, 18563,
18563, 18563, 18563, 18563, 18563, 18563, 18563, 18563, 18563,
18563, 18564, 18564, 18564, 18564, 18564, 18564, 18564, 18564,
18564, 18564, 18564, 18564, 18564, 18564, 18564, 18559, 18559,
18559, 18559, 18559, 18559, 18558, 18558, 18558, 18558, 18558,
18558, 18558, 18558, 18558, 18558, 18558, 18558, 18560, 18560,
18560, 18560, 18560, 18560, 18560, 18560, 18561, 18561, 18561,
18561, 18561, 18561, 18561, 18561, 18561, 18561, 18561, 18561,
18561, 18561, 18561, 18562, 18562, 18562, 18562, 18562, 18562,
18562, 18562, 18562, 18562, 18562, 18562, 18562, 18562, 18562,
18562, 18562, 18563, 18563, 18564, 18564, 18564, 18564, 18564,
18564, 18564, 18564, 18564, 18564, 18564, 18564, 18564, 18564,
18564, 18564, 18564, 18564, 18564, 18564, 18556, 18558, 18558,
18558, 18558, 18558, 18558, 18558, 18558, 18559, 18559, 18559,
18559, 18559, 18562, 18562, 18562, 18563, 18563, 18563, 18564,
18564, 18564, 18564, 18564, 18557, 18558, 18558, 18558, 18558,
18558, 18558, 18558, 18559, 18559, 18559, 18559, 18559, 18560,
18560, 18560, 18560, 18561, 18561, 18561, 18561, 18562, 18562,
18562, 18562, 18562, 18563, 18563, 18563, 18563, 18563, 18563,
18563, 18563, 18564, 18564, 18564, 18556, 18556, 18556, 18556,
18557, 18558, 18558, 18558, 18558, 18558, 18558, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559, 18559,
18559, 18559, 18559, 18559, 18559, 18559, 18560, 18560, 18560,
18560, 18560, 18560, 18560, 18560, 18560, 18561, 18561, 18561,
18561, 18561, 18561, 18561, 18561, 18561, 18561, 18561, 18561,
18561, 18561, 18561, 18562, 18562, 18562, 18562, 18562, 18562,
18563, 18563, 18563, 18563, 18563, 18563, 18563, 18563, 18563,
18564, 18564, 18564, 18564, 18564, 18564, 18564