Hi,
I have Four scenarios on installing packages in R console from Alteryx Designer- Out of which three of them fails and shows the error-Error: R (1): Error in install.packages("package name") : unable to install packages.
Scenario- 1- Trying to install fpp2 package
I used a simple code- install.packages("fpp2") to install fpp2 package- it failed
Scenario- 2- Trying to install fpp2 package- using conditional install
cond.install <- function(package.name){
options(repos = "http://cran.rstudio.com")
if(package.name%in%rownames(installed.packages())==FALSE) {
install.packages(package.name)}else{require(package.name, character.only = TRUE)}}
cond.install("fpp2")
library("fpp2")
It failed saying couldn't install the package
Scenario- 3- Trying to install data.table package
I used a simple code- install.packages("data.table") to install data.table package- it failed
Scenario- 4- Trying to install data.table package using conditional install
cond.install <- function(package.name){
options(repos = "http://cran.rstudio.com")
if(package.name%in%rownames(installed.packages())==FALSE) {
install.packages(package.name)}else{require(package.name, character.only = TRUE)}}
cond.install("data.table")
library("data.table")
It compiled with no error
So if anyone could help me on how to install packages in R and why does the simple install.package code fails while installing both packages and conditional install works fine only with data.table package.
Please help me with the best method to install packages in R console from Alteryx Deisgner.
As i'm new to this and trying to learn.
We use Alteryx Designer 2020.2 and Alteryx Predictive tools with R 3.6.3- Admin version
Please advise
Thank you