Hey everyone!
I am trying to save a png file in a folder on the KNIME server using R.
This is the code that I am running for a local folder:
library(png)
save_png <- function(plot, path){
DiagrammeRsvg::export_svg(plot) %>%
charToRaw() %>%
rsvg::rsvg() %>%
png::writePNG(path)
}
save_png(picture, "C:/Users/test/Visualizations/finalPicture.png")
The code above works and saves the picture I need in a local folder. But when I replace the path relative to the KNIME server. For example,
knime://knime-server/Users/tests/project1/data/finalPicture.png
It fails and gives me the following error:
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:utils':
timestamp
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
Linking to librsvg 2.48.8
Error: unable to create knime://knime-server/Users/tests/project1/data/finalPicture.png
It would be great if someone could resolve this for me. At the beginning of the script, the necessary packages are being installed using install.packages(…). So I think the packages are all installed on the server.
Thank you!