I've tried to change the character variable into a variable of class Date, then changed it to the last day of the month.
data %>% mutate("Month"= as.Date(paste(Month,"-01",sep=""))) -> data
data$Month <- paste(format(data$Month, format="%Y-%m"),"-", days_in_month(data$Month), sep="")
This works when run through the console but when I try to knit to pdf I get
Error in days_in_month(data$Month) : could not find function "days_in_month" Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> paste In addition: Warning message: In has_crop_tools() : Tool(s) not installed or not in PATH: ghostcript -> As a result, figure cropping will be disabled. Execution halted
I want to keep as.Date and days_in_month() but I'm not sure what I'm doing wrong and is it possible to join the second line of code to the first line?