Open madelinestanley opened 3 years ago
@madelinestanley,
There is a previous issue that provides a solution to use gtsave()
to save as a .pdf
.
If your problem is more with the implementation using here()
, would you be able to push the code as you have it now and i can take a look?
Hi Pepe,
I have pushed the Rmd to the repo. I did follow the gt save as described before, but am unable to make it work.
I also am having trouble with developing the plot. It says that my x value is non-numeric, but is a year. I was curious how I can set a year as factor when working in multiple tibbles? I tried to do a mutate in lines 116 onward before creating the mutate(plot) code, by doing mutate(year=as.factor(data$year)) or something along these lines, but it is not working. Any advice on this as well?
So for anyone else having this problem, I was able to fix my gtsave problem by installing the webshot package and then installing another function within that as requested in the console. That then allowed me to save my gt table in my results folder as a pdf/png.
However, Pepe, my other question my ggplot remains.
Thanks
Awesome on the saving the table front. Let me take a look on the other thing.
@peperg I will re-push my current code to github so you have the most up to date version.
@madelinestanley, ok, your assessment was correct. Your years are still considered as a character variable, that is why it cannot properly plot them in a continuous scale. This is because they came from a step in which we extracted them from a string. Numbers are characters too, if you don't specify that they are numbers and they came from a character string, they are still a character string. You will need to transform them to numeric. I recommend yo do this early in the code, before any of the modelling steps as well.
Also, as a side note print()
doesn't seem to like gt
objects. You can just write the object name alone and it does the same as the print()
function, and... it works with gt
objects!
Pepe
Hi Pepe,
Great thank you. I was trying to set them as numeric later on. I will try doing earlier and hopefully that helps my problem. I will let you know if I have any further questions.
Madeline
I have created a GT summary table for the week 11 homework assignment, but I am having trouble saving the table into the results folder. I have tried using the gtsave() function, but I also want to integrate here() so I can direct it to a particular folder.
Any advice on how to do this?
Thanks!