I tried creating a basic graph with the code below and I keep the message: Error: unexpected symbol in " geom_bar( aes ( x = Specimen Month"
library(tidyverse)
library(ggplot2)
ggplot(Inmatelist) +
geom_bar( aes ( x = Specimen Month), fill = Test Results (blue)
I do the same code without the "+" and I keep getting the same results.
I tried another code:
ggplot(Inmatelist, aes(x = Specimen Month, y = Test Result, fill=supp)) +
geom_bar(stat="Inmatelist", position=position_dodge()) + scale_fill_brewer(palette="Paired") +
theme_minimal ()
scale_fill_manual(values=c('#102a4c','#f37021'))
labs(x = "Specimen Month", y = "Test Result", title = "HCJ Results by Month")
and I get the error code:
Error: Can't find stat
called 'Inmatelist'
Run rlang::last_error()
to see where the error occurred.
scale_fill_manual(values=c('#102a4c','#f37021'))
<ggproto object: Class ScaleDiscrete, Scale, gg>
aesthetics: fill
axis_order: function
break_info: function
break_positions: function
breaks: waiver
call: call
clone: function
dimension: function
drop: TRUE
expand: waiver
get_breaks: function
get_breaks_minor: function
get_labels: function
get_limits: function
guide: legend
is_discrete: function
is_empty: function
labels: waiver
limits: NULL
make_sec_title: function
make_title: function
map: function
map_df: function
n.breaks.cache: NULL
na.translate: TRUE
na.value: NA
name: waiver
palette: function
palette.cache: NULL
position: left
range: <ggproto object: Class RangeDiscrete, Range, gg>
range: NULL
reset: function
train: function
super: <ggproto object: Class RangeDiscrete, Range, gg>
rescale: function
reset: function
scale_name: manual
train: function
train_df: function
transform: function
transform_df: function
super: <ggproto object: Class ScaleDiscrete, Scale, gg>
labs(x = "Specimen Month", y = "Test Result", title = "HCJ Results by Month")
$x
[1] "Specimen Month"
$y
[1] "Test Result"
$title
[1] "HCJ Results by Month"
attr(,"class")
[1] "labels"
I have only used R to analyze data in a database. This is the first time I am analyzing data in an excel spreadsheet. I am also still new to R. The data is categorical as well, I don't know if that makes a difference. Test results are positive, negative, or unknown. The months is January, February, etc.