Error: 'set_envvar' is not an exported object from 'namespace:xfun' - r

I'm trying to run Data Exploration in my R Studio, version 1.3.959 on my windows10.I wrote following test code
if (!require(devtools)) install.packages("devtools")
devtools::install_github("boxuancui/DataExplorer", ref = "develop")
library(DataExplorer)
diabetes_data <- read.csv("https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.csv", header = FALSE)
names(diabetes_data) <- c("number_of_times_pregnant", "plasma_glucose_conc", "diastolic_bp", "triceps_skinfold_thickness", "two_hr_serum_insulin", "bmi", "diabetes_pedigree_function", "age", "label")
# create report
create_report(diabetes_data)
But I'm getting error message
Error: 'set_envvar' is not an exported object from 'namespace:xfun'
Can you please help me to resolve the issue?

I just had this problem and updating my packages solved the issue, especially the package xfun from which set_envvar is originated.

Related

'extract_doi' is not an exported object from 'namespace:impactr'

I want to install the package impactr from github. Following the guideline stated by the package developer (https://rdrr.io/github/kamclean/impactr/f/vignettes/vignette_2_extract.Rmd), I repeatedly get the following error.
devtools::install_github("kamclean/impactr")
my_dois <- c("10.1111/j.1365-2486.2008.01617.x","10.1007/s10533-011-9655-2")
out_doi <- impactr::extract_doi(doi = my_dois, get_impact = TRUE)
Error: 'extract_doi' is not an exported object from 'namespace:impactr'
What is the problem? Any help is highly appreciated!

Error in seas(AirPassengers) : no output has been generated

I am getting this error when I run:
library(seasonal)
m <- seas(AirPassengers)
I have installed the package.
I have uninstalled R, Rstudio, reinstalled and tried again, same error.
Could someone help?
Thanks
I can't reproduce exactly the same error now but I remember following error after I installed the seasonal package:
Error in seas(AirPassengers) : could not find function "seas"
After cleaning up my workspace the error was gone.
Following code is working for me and resulting in the plot below:
library(seasonal)
head(AirPassengers)
m <- seas(AirPassengers, regression.aictest = c("td", "easter"))
plot(m)

Error when exporting R data frame using openxlsx ("Error in zipr")

Usually I'm using the openxlsx package and the write.xlsx function when exporting R data frames into .xlsx-files. Since yesterday - probably after I was using the package XLConnect - something got messed up and the write.xlsx function doesn't work anymore. This is the error I get:
Error in zipr(zipfile = tmpFile, include_directories = FALSE, files = list.files(path = tmpDir, :
unused argument (include_directories = FALSE)
Unfortunately, I don't understand what this error means. Thanks for any helpful advice.
Edit: The function works when I use an older openxlsx version (4.1.0).
I was getting the same error.
I think the problem is with dependencies of openxlsx. There is a "zipR" package that might be picked up when you install openxlsx, while the actual dependency is zip package:
https://cran.r-project.org/web/packages/zip/index.html
https://cran.r-project.org/web/packages/zipR/zipR.pdf
I installed "zip" along with openxlsx and I don't get the error anymore.
I do not really understand the error message here. My computer does not allow me to save files to "c:/". So, if remove "c:/" part, it works fine, to save the file to the current working directory.
library(openxlsx)
df <- data.frame('x' = c(1,2,3),
'y' = c(3,2,1))
openxlsx::write.xlsx(df, "test.xlsx")
You would also try another package: writexl
writexl::write_xlsx(df, "text5.xlsx")`
This works on my machine.

rCharts dTable Error

Hi I'm new to rCharts and could definitely use some help. I'm getting the error below when I try to run the following.
Code:
dTable(airquality, sPaginationType = "full_numbers")
Error:
Error in as.character(tools:::httpdPort) :
cannot coerce type 'closure' to vector of type 'character'
Also when I try ?dTable I get the message:
No documentation for ‘dTable’ in specified packages and libraries:
you could try ‘??dTable’
I installed rCharts and devtools using:
install.packages("devtools")
and
install.packages("base64enc")
devtools::install_github("ramnathv/rCharts")
then I called both libraries using library(devtools) and library(rCharts).
Any tips greatly appreciated.
I created a fig directory under my current working directory, ran the following code and it created an html file with the sortable table in the fig directory:
#install.packages("devtools")
install.packages("base64enc")
require(base64enc)
library(devtools)
require(rCharts)
data("airquality")
table1 <- dTable(airquality, sPaginationType = "full_numbers")
table1$save('./fig/table1.html', standalone=TRUE)

R could not find function "checkAtAssignment" while running rworldmap

I need your help with R not being able to run a function with rworldmap package.
When using rworldmap package in R and trying to 'joinCountryData2Map'
sPDF <- joinCountryData2Map (myframe, joinCode = "NAME", nameJoinColumn = "location", verbose = TRUE, suggestForFailedCodes = TRUE )
I get the following error:
Error in mapWithData#data <- cbind(mapWithData#data, dF[matchPosnsInUserData, :
could not find function "checkAtAssignment"
Calls: joinCountryData2Map
Execution halted
My guess is that R needs methods package, which I could not find for my R version.
Any suggestings why I 'could not find function "checkAtAssignment"'?
My R version is 3.0.2 Patched.
Using rworldmap package requires loading library(methods). I am writing it here because it was really not obvious.
Dunno what "R 3.0.2 Patched" means, but yes you are correct that somehow you don't have the methods package, which is included in the standard installation package. How about reinstalling R from the binaries or source tarball at CRAN -- that should solve your problem.

Resources