R
error
bash
n
glm()
hoslem.test()
complete.cases
cat
merge
dplyr::filter
dplyr::group_by_
dplyr::summarize
read.table(fill=TRUE)
tryCatch()
.libPaths()
R.home()
Sys.getenv()
ifelse()
unloadNamespace()
is.na()
dplyr::mutate()
dplyr::case_when()
dplyr::summarise_at()
dplyr
rlang
attributes()
foreach()
%dopar%
%:%
%do
devtools::install_github()
install.packages()
Issue Graph color not matched legend color. activity.type='Strength & Stability Workout' is shown in gray, not pink. Using a different color palette doesn't make a difference.
Issue R files shown as 0 KB. R files reopened as empty in RStudio.
Solution I had a similar issue with older R files that opened as empty. It turned out that RStudio didn't use the correct encoding as default and therefore wasn't able to read the file (presented the file as empty). You can make sure that you are using the correct encoding by:
0. Copying R code to a text file
Error Warning in install.packages : 'lib = "C:/Program Files/R/R-4.0.3/library"' is not writable Error in install.packages : unable to install packages
Solution Close RStudio/R. Run it as administrator
"not writable" error when installing new packages on 3.2.0
Error devtools::install_github("DillonHammill/CytoExploreRData")
Downloading GitHub repo DillonHammill/CytoExploreRData@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet, :
cannot open URL 'https://api.github.com/repos/DillonHammill/CytoExploreRData/tarball/HEAD'
Solution In RStudio, Tools > Global options> Package > check the Use secure download method for HTTP box
having trouble getting devtools::install_github() to work in R on Win 7 64bit machine
Secure Package Downloads for R
Error The procedure entry point EXTPTR_PTR Rcould not be located in the dynamic link library
Solution Use a R version no later than the package to load. For instance, to load package ‘magick’ that was built under R version 4.0.2, use R version 4.0.2. Using a version older than R-4.0.2 could result in the error.
I experienced that the "Entry Point" error message (concerning "rlang.dll", "Rcpp.dll" or other .dll) occures when using/choosing a lower R version in RStudio on packages of a higher built , i.e. using R 3.4 on packages of built 3.5, e.g. after using update.packages(…, checkBuilt = TRUE) on user library of lower R Version 3.4…after getting rid of the packages of the higher built or re-installing them on the lower built in the user library, no "Entry Point" error messages occure anymore when using the lower R Version R 3.4… Entry point Not Found #416
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/
Warning in install.packages :
package ‘edgeR’ is not available (for R version 3.6.2)
Solution
BiocManager::install(pkgs=)
Warning message: funs()
is deprecated as of dplyr 0.8.0. Please use a list of either functions or lambdas:
Error: .vars
must be a character/numeric vector or a vars()
object, not a formula
object.
Solution Specify the functions to summarise or rename multiple columns using
vars("column1","column2","column3"), ~functionName()
vars("column1","column2","column3"), list(~function1(), ~function2())
Warning message for dplyr package when trying to utilize the summarise_each function
Error: "Error in unserialize(socklist[[n]]) : error reading from connection"
In addition: Warning messages:
1: In .Internal(gc(verbose, reset, full))
closing unused connection 9 (<-QIMR18447.adqimr.ad.lan:11372)
2: In .Internal(gc(verbose, reset, full))
closing unused connection 8 (<-QIMR18447.adqimr.ad.lan:11372)
3: In .Internal(gc(verbose, reset, full))
closing unused connection 7 (<-QIMR18447.adqimr.ad.lan:11372)
4: In .Internal(gc(verbose, reset, full))
closing unused connection 6 (<-QIMR18447.adqimr.ad.lan:11372)
5: In .Internal(gc(verbose, reset, full))
closing unused connection 5 (<-QIMR18447.adqimr.ad.lan:11372)
6: In .Internal(gc(verbose, reset, full))
closing unused connection 4 (<-QIMR18447.adqimr.ad.lan:11372)
7: In .Internal(gc(verbose, reset, full))
Error: Error in foreach(i = 1:length(Exp08.categorised.predictors.list), .combine = "rbind", :
"%:%" was passed an illegal right operand
Solution: Nest foreach loops correctly as shown in the code below. Outer loop variable in nested R foreach loop
Error: x
must be a vector, not a data.frame/surv_categorize
object.
Solution Multiple classes in the data attributes cause the error. Changing the class to data.frame only gets rid of the error while running base functions (e.g., nrow(), names()) within dply package.
Error: package or namespace load failed for ‘dplyr’: .onLoad failed in loadNamespace() for 'pillar', details: call: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) error: namespace ‘rlang’ 0.4.1 is already loaded, but >= 0.4.2 is required
Solution The error occurred because the rlang package that was automatically loaded when starting R is in a version older than the rlang version required by another package dplyr. To rid of this error, try
Error in get_oauth_sig() : OAuth has not been registered for this session
rlang::last_error()
to see a backtrace.` Error arises because column c is not found in the data.frameError: package dplyr was installed by an R version with different internals; it needs to be reinstalled for use with this R version In addition: Warning message: package ‘dplyr’ was built under R version 3.5.1
It depends on how you use your custom installed libraries. If you use them "stand-alone" i.e. without /software/R/version in your libPaths, then deleting that folder will break anything installed to your ~/R directory that depends on Rcpp (which could be a lot of things), so I wouldn't necessarily recommend that. The real root of the issue here is that there is no way to guarantee that software you've installed yourself in one location is compatible with software compiled and installed to a different location, but you can try one of the following:As you suggested, just set .libPaths("/software/R/R-3.4.1/lib64/R") at the start of your session so you're only using the installed system libraries. This is the safest option.
Reverse the order of paths in libPaths, e.g. .libPaths(system path, custom path) so that the system libraries are found first. Then at least the system libraries will work. If (and there's no guarantee) your custom libraries are compatible with the system libraries, then those will also work.
Xikun: if you mould load R/3.5.1 then in the R script simply library(package). Don't add lib path as this will result in a conflict
> detach("package:plyr", unload=TRUE) Error in detach("package:plyr", unload = TRUE) : invalid 'name' argument
Error in ifelse(m$cohorts == "UKB" & m$traits.abb == "CI", "OA", ifelse(m$cohorts == : unused arguments ("OA, GA", "GA")
This error occurred when a ifelse() doesn't contain 3 arguments. A simple check is to see if there are 2 commas in each ifelse, and the number of ifelse() functions is similar to the number of ending brackets.Error in filter_impl(.data, quo) : Evaluation error:
as_dictionary()is defunct as of rlang 0.3.0. Please use
as_data_pronoun() instead.
The error occurred when running dplyr::filter()
The error is gone after HPC Admin updated the package dplyrError in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘rlang’ 0.2.1 is already loaded, but >= 0.3.1 is required
occurred while running library(dplyr)
There are two problems (1)rlang
in the dafault path is in an old version, (2) the default path is in a user created folder that is not centrally controlled.tryCatch()
Error in [[.default(group, 1) : subscript out of bounds
It means you're trying to get something, say the column you are subsetting has a varying number of delimiter _ but your search pattern is built without considering this.mutate_each()
is deprecated. Use mutate_all()
, mutate_at()
or mutate_if()
instead. To map funs
over a selection of variables, use mutate_at()
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 194 did not have 14 elements
read.table
wants to return a data.frame, which must have an element in each column. Therefore R expects each row to have the same number of elements and it doesn't fill in empty spaces by default. Try read.table("/PathTo/file.csv" , fill = TRUE ) to fill in the blanks.Error in full_join_impl(x, y, by$x, by$y, suffix$x, suffix$y, check_na_matches(na_matches)) : std::bad_alloc
means you are running out of RAMError: This function should not be called directly
or Error in n() : This function should not be called directly
Both dplyr and plyr have the functions summarise/summarize. The error is due to the conflict of the same function of different packagesError in fix.by(by.x, x) : 'by' must specify a uniquely valid column
Warning messages: In cor(variable1, variable2, method = correlation_method, use = "complete.obs") : the standard deviation is zero
ERROR converting summary statistics
in LD score regression is possibly caused by one of the columns are empty*Error converting summary statistics
Error in model.frame.default(formula = cbind(y0 = 1 - y, y1 = y) ~ cutyhat) : variable lengths differ (found for 'cutyhat')
Error in
contrasts<-(
tmp, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels
occurs when there is not enough variation in the dependent variable with only one value. So, you need to drop that variable, irrespective of whether that is numeric or character or factor variable.*Error in contrasts when defining a linear model in R
dplyr: Error in n(): function should not be called directly
Possibly you have dplyr and plyr loaded in the same session. Both dplyr and plyr have the functions summarise/summarize. You may have a conflict between plyr and dplyr. You can unload the plyr package and load dplyr package.Both dplyr and plyr have the functions summarise/summarize.
cat: write error: Broken pipe
occurred while using CompileProfileFiles.shError in plot.new() : figure margins too large
first appears. Then Error in ... plot.new has not been called yet
appears from every plotting functionforeach error “could not find function ”%do%“”
Each of the parallel workers operates in a clean R session, so you have to load the foreach package in each worker. Try adding .packages="foreach" to your first lineError in plot.window(xlim, ylim, log = log, ...) : need finite 'ylim' values
*R: need finite 'ylim' values in function
Error in \[.data.frame`(dataPhenoPRS, , fixEffect) : undefined columns selected
This usually results from the variable name is not exactly matched between a data set and another data set that the first data set looks for