i am trying to knit gpplot code to pdf file and it gives me an error.The dataframe in R is called retailyoy and the plot is to show .The code run in R Markdown give me this output.
but gives me problem when i am trying to knit.Below is error message:
"Error in ggplot(data = retailyoy, aes(x = retailyoy$Supplier Name, y = retailyoy$SALES_CHANGE, :
object 'retailyoy' not found
Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> ggplot
Execution halted"
Below is the chunk code:
library('ggplot2')
p1=ggplot(data=retailyoy, aes(x=retailyoy$`Supplier Name`, y=retailyoy$SALES_CHANGE, fill=DEPARTMENT, coord_cartesian(xlim = c(-200, 200))))+ geom_bar(stat="identity") + coord_flip() + scale_fill_brewer(palette="Dark2") + labs(title="YEAR ON YEAR GROWTH OF SALES",x="SUPPLIER NAME", y = "%YOY GROWTH")
p1+ geom_boxplot()
i am trying to knit gpplot code to pdf file and it gives me an error.The dataframe in R is called retailyoy and the plot is to show .The code run in R Markdown give me this output.
but gives me problem when i am trying to knit.Below is error message:
"Error in ggplot(data = retailyoy, aes(x = retailyoy$ ... withCallingHandlers -> withVisible -> eval -> eval -> ggplot
Execution halted"
Supplier Name
, y = retailyoy$SALES_CHANGE, : object 'retailyoy' not found Calls:Below is the chunk code: