I had one favorite function, extremely useful for adjusting plots: graph2ppt. It allowed to change the text parts of the plot (labels, legend, everything) directly in the power point.
It was inside the "export" package, which is removed from CRAN repository (https://cran.r-project.org/web/packages/export/index.html). I tried to install the version from the archive, but there are some issues and the package doesn't work.
You should be able to get it working by downloading the gzipped 'tarball' from HERE, and then installing manually. You may, first, have to install other dependencies, though. Here is what I had to do:
install.packages('export_0.2.2.tar.gz')
ERROR: dependencies ‘officer’, ‘rvg’, ‘flextable’, ‘rgl’, ‘stargazer’ are not available for package ‘export’
Thank you! Did you try to export a plot using the function? Did it work?
I tried to copy your example. I downloaded the package (and it lies in the "download" folder, should I place it somewhere else?) and ran the code that you used. I see the next error:
(the prinscreen seems not to attach properly for some reason, so I copy the error as a text:
"Installing package into ‘C:/Users/Poisk/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘export_0.2.2.tar.gz’ is not available (for R version 3.6.3)"
You can place the archive / file anywhere on your disk. As you are on Windows, please install it like this (assuming that the file is saved under 'C:/Users/Poisk/download/'):
install.packages('C:/Users/Poisk/download/export_0.2.2.tar.gz', repos = NULL, type = 'source')
All other packages installed in the correct way - yes?
Ohh, it indeed is something inside. There is nothing about ph_with_vg_at or officer::ph_with in the graph2office function. It seems to be something inside rgv package, or officer (here is the picture: https://ibb.co/TcXxbnN )
Thank you very much for your help!
Could you probably test whether the exporting function works in your case? Just to understand whether it's a problem of my computer, or it exists for everyone who has R 3.6.3.
(if you have R 3.6.3, of course)
Ah, yes! - I have the same error. I also use R 3.6.3. I have tried to get around it but it seems like it could take a lot of time. I searched, though, and there are quite a few other possibilities online:
Btw :). I tried all them, they are not supported by the last R version too. Ok, I will modify plot in the R itself and hope that the developers will fix it one day.
Just for information
Thank you! Did you try to export a plot using the function? Did it work?
I tried to copy your example. I downloaded the package (and it lies in the "download" folder, should I place it somewhere else?) and ran the code that you used. I see the next error:
(the prinscreen seems not to attach properly for some reason, so I copy the error as a text: "Installing package into ‘C:/Users/Poisk/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘export_0.2.2.tar.gz’ is not available (for R version 3.6.3)"
What do I do wrong?
You can place the archive / file anywhere on your disk. As you are on Windows, please install it like this (assuming that the file is saved under 'C:/Users/Poisk/download/'):
All other packages installed in the correct way - yes?
Yes, and the "export" package installed :) But it doesn't work anyway:
ggplot(alls_nolncRNA,aes(x=Length, fill=Source)) + geom_density(color='black',alpha=0.5) + xlim(c(0,20000)) + xlab('Transcript length, bp') + ylab('Density'))
graph2ppt(file="Rplot.pptx",width=7,height=6)
Error: 'ph_with_vg_at' is defunct. Use 'officer::ph_with' instead. See help("Defunct")
Does it export a plot in your case?
You can probably just edit the function, to be honest. Here it is (just type
graph2office
at your command prompt):You could start by changing instances of
ph_with_vg_at
toofficer::ph_with
. There may be subsequent errors, but I am not to know that yet.Ohh, it indeed is something inside. There is nothing about ph_with_vg_at or officer::ph_with in the graph2office function. It seems to be something inside rgv package, or officer (here is the picture: https://ibb.co/TcXxbnN )
Thank you very much for your help!
Could you probably test whether the exporting function works in your case? Just to understand whether it's a problem of my computer, or it exists for everyone who has R 3.6.3. (if you have R 3.6.3, of course)
Ah, yes! - I have the same error. I also use R 3.6.3. I have tried to get around it but it seems like it could take a lot of time. I searched, though, and there are quite a few other possibilities online:
It seems that export merely provided wrapper functions that utilised these other packages.
Thank you! That's exactly what I was looking for. And thank you for your help in general.
Btw :). I tried all them, they are not supported by the last R version too. Ok, I will modify plot in the R itself and hope that the developers will fix it one day. Just for information