Install new packages for pre-packaged Windows only R Extension ?

Hi all

I use the pre-packagd Windows R Extension within KNIME und have a R script that starts with the following rows. How can I add new R packages to KNIME?

install.packages("portfolio")

library(portfolio)

data<-read.csv("filename")

 

Frank

You could try this workaround, which is slightly complex, as you need to specify the mirror to use (which is not specified in the internal R installation in KNIME):

s = getOption("repos") # hard code the UK repo for CRAN
s["CRAN"] = "http://cran.uk.r-project.org"
options(repos = s)
rm(s)

install.packages("portfolio")
library(portfolio)

 

Hope that helps!

Steve

Hi Steve

Thanks for your quick reply. You code example helped, but I want to generate a treemap with R Snippet and Table R-View nodes, but I can only see the scatterplot matrix in the Table R-View node. Is something missing in my code?

I attached an example workflow.

Und this is the code in the R snippet:

s = getOption("repos") # hard code the UK repo for CRAN
s["CRAN"] = "http://cran.uk.r-project.org"
options(repos = s)
rm(s)

install.packages("portfolio")
library(portfolio)

R<-R
map.market(id=R$Film, area=R$Umsatz, group=R$Genre, color=R$Kritiker, lab=c(TRUE, TRUE), main ="Hollywood-Filme 2011")

Frank

Hi

I have solved my problem on my own.

If one wants to genrate an image with R code, place the R code in an Table R-View node, not in an R Snippet node.

 

Frank