Hello,
I'm using the r developer tool and it runs fine on the following code:
# Load the packages
package_name <- c("ggplot2", "tibble", "tidyr",
"purrr", "dplyr", "segmented", "broom",
"stringr")
altx.repo <- getOption("repos")
altx.repo["CRAN"] <- "http://cran.rstudio.com
options(repos = altx.repo)
if(package_name %in% rownames(installed.packages())==FALSE) {
install.packages(package_name)
}
lapply(package_name, library, character.only = TRUE)
# Read in the data from Alteryx into R
the_data <- read.Alteryx("#1", mode="data.frame")
But as soon as I add
write.Alteryx(the_data, 1)
it errors out and says it can't find the object the_data. Is there any reason the data object would fall out?
Solved! Go to Solution.
Hey @jbh1128d1,
I believe that the issue is caused by altx.repo["CRAN"] <- "http://cran.rstudio.com
(string is not closed).
Thanks,
Paul Noirel
Sr Customer Support Engineer, Alteryx
Thanks @PaulN.
That helped get past that line, but now I get an error that the segmented package is not htere. I can see the segmented package at the https://cran.rstudio.com/ address and I use it in RStudio.
Update: If I take every package out but segmented, it works. Is there a limit to how many packages I can load using Alteryx?
Hi @PaulN.
After deleting the package name line and re-adding them one at a time, it seems to be running fine now. Thank you for the help.
Hey @jbh1128d1,
I am glad you could find solution.
In your original code there was the following line:
if (package_name %in% rownames(installed.packages()) == FALSE) {
This doesn't produce a single value (see https://cran.r-project.org/doc/manuals/r-release/R-intro.html#Conditional-execution, section 9.2.1 for reference) but a vector of size length(package_name)
This explains why original code was producing following warning:
the condition has length > 1 and only the first element will be used
Thanks,
Paul Noirel
Sr Customer Support Engineer, Alteryx
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |