Error of prcomp in R - r

I am running a microarray data analysis,
raw_data = read.celfiles(....... )
exp_raw <- log2(exprs(raw_data))
PCA_raw <- prcomp(t(exp_raw), scale = FALSE)
and I got
Error in La.svd(x, nu, nv) : LAPACK routines cannot be loaded
Besides: Warning message:
In La.svd(x, nu, nv) :
unable to load share-object'/Library/Frameworks/R.framework/Resources/modules//lapack.so' : `maximal number of DLLs reached...
this is the packages I loaded
library(Biobase, oligoClasses, knitr, BiocStyle, oligo, geneplotter, ggplot2, dplyr, LSD, gplots, RColorBrewer, ArrayExpress, arrayQualityMetrics, stringr, matrixStats, topGO, genefilter, pd.hugene.1.0.st.v1, hugene10sttranscriptcluster.db, pheatmap, mvtnorm, DAAG, multcomp, limma, ReactomePA, clusterProfiler, openxlsx, devtools, biomaRt, EnrichmentBrowser)
my session info
setting value
version R version 3.4.1 (2017-06-30)
system x86_64, darwin15.6.0
ui RStudio (1.0.153)
language (EN)
collate zh_TW.UTF-8
date 2017-10-03
Can someone tell me how to fix this?

Related

GVIZ on R not loading mm10 from UCSC

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6
I am trying to load an ideogram track for the mm10 mouse genome on GVIZ. This always used to work but now is giving me the below error:
> itrack <- IdeogramTrack(genome = "mm10", chromosome = "chr5")
Error in value[3L] :
There doesn't seem to be any chromosome length data available for genome 'mm10' at UCSC or the service is temporarily down.
In addition: Warning message:
In value[3L] :
There doesn't seem to be any cytoband data available for genome 'mm10' at UCSC or the service is temporarily down. Trying to fetch the chromosome length data.
One solution is to update R and reinstall Gviz via Bioconductor:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Gviz")
library(Gviz)
itrack <- IdeogramTrack(genome = "mm10", chromosome = "chr5")

response.plot3() crashes RStudio

0. Session information
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
1. Summary of my issue
I am having a crash while using a modified function of response.plot2(), named response.plot3(). The problem is not the function in itself, as the same problem occurs with response.plot2().
2. Code
library(biomod2)
library(raster)
library(reshape)
library(ggplot2)
setwd("xxx")
# I load the modified version of response.plot2()
source("/response.plot_modified.R", local = TRUE)
sp <- "NAME"
baseline_EU <- readRDS("./data/baseline_EU.rds")
initial.wd <- getwd()
setwd("models")
# Loading of formatted data and models calibrated by biomod
load(paste0(sp, "/run.data"))
load(paste0(sp, "/model.runs"))
# Variables used for calibration
cur.vars <- model.runs#expl.var.names
# Loading model names into R memory
models.to.plot <- BIOMOD_LoadModels(model.runs)
# Calculation of response curves with all models (stored in the object resp which is an array)
resp <- response.plot3(models = models.to.plot,
Data = baseline_EU[[cur.vars]],
fixed.var.metric = "sp.mean",
show.variables = cur.vars,
run.data = run.data)
I have got 60 models and the code plot the first curve before aborting the session, with no further explanation.
3. What I unsuccessfully tried
(1) check that it was not a ram issue
(2) uninstall-reinstall all the packages and their dependencies
(3) uptade to the last R version
(4) go back to response.plot2() to see if the issue could come from response.plot3()
4. I found some similar errors which lead me to think that it might be a package issue
https://github.com/rstudio/rstudio/issues/9373
Call to library(raster) or require(raster) causes Rstudio to abort session
Now I presume that there is a problem either with the biomod2 or the raster packages, or maybe the R version?
I would greatly appreciate your help if you have any ideas.

How to approach this strange error when working with the flextable library in R?

I'm trying to use the flextable library to make tables in RMarkdown (on an RStudio server). I'm getting a strange error message and can't make any progress on figuring out what I'm doing wrong. I'm getting this error message: Error in UUIDgenerate(n = nrow(uid), use.time = TRUE) :
unused argument (n = nrow(uid)).
NOTE: The error occurs when I tried to run the code within the RMarkdown document to the console. The code below (and error output) occurred in an R Script.
This code below produces the error:
library(flextable)
ft <- flextable(head(mtcars))
ft
Error in UUIDgenerate(n = nrow(uid), use.time = TRUE) :
unused argument (n = nrow(uid))
head_ft <- flextable(as.data.frame(mtcars))
head_ft
Error in UUIDgenerate(n = nrow(uid), use.time = TRUE) :
unused argument (n = nrow(uid))
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)
packageVersion("flextable")
[1] ‘0.5.11’
You need to update the package uuid. This issue is solved in the latest releases of flextable, so updating flextable should also update uuid automatically

Newsmap topic classification: issue with "predict" step of the newsmap process

I am giving a try to the Newsmap package for topic classification (not geographical, but you know, implementing to other tasks...). I follow the instructions from the Quanteda tutorials website (here).
Everything runs smoothly until I try to predict the topic most strongly associated with each of my texts.
Here is the code:
labels <- types(toks_labelExclu)
dfmt_label <- dfm(toks_labelExclu, tolower = FALSE) # The dfm with the labels of my 35 topics
dfmt_feat <- dfm(toks_sent) %>%
dfm_trim(min_termfreq = 50) # The dfm with the features to be associated with my topics
model_nm <- textmodel_newsmap(dfmt_feat, dfmt_label)
coef(model_nm, n= 20)[labels] # All good so far
pred_nm <- predict(model_nm)
# Here is the snag: the function returns
Error in x[, feature] : Subscript out of bounds
Does anyone have an idea of where the error could come from?
For information, here is the sessionInfo:
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.4
other attached packages:
[1] newsmap_0.7.1 quanteda_2.0.1

Getting TTR to work on R 2.13? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Cannot install R-forge package using install.packages
Has anyone gotten the latest version of TTR from R-forge working on R 2.13? I can't install it on either my mac or my PC, even if I try compiling from the source.
/edit: here's the exact error I'm getting, when I try to install from the R command line.
install.packages("TTR", repos="http://R-Forge.R-project.org")
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘TTR’ is not available (for R version 2.13.0)
Yes, sure:
edd#max:~/svn/ttr$ svn up
At revision 107.
edd#max:~/svn/ttr$ R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘TTR’ ...
** libs
make: Nothing to be done for `all'.
installing to /usr/local/lib/R/site-library/TTR/libs
** R
** data
** preparing package for lazy loading
Loading required package: zoo
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
* DONE (TTR)
and
edd#max:~/svn/ttr$ R -e 'library(TTR); example(EMA)'
R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
[...]
R> library(TTR); example(EMA)
Loading required package: xts
Loading required package: zoo
EMAR> data(ttrc)
EMAR> ema.20 <- EMA(ttrc[,"Close"], 20)
EMAR> sma.20 <- SMA(ttrc[,"Close"], 20)
EMAR> dema.20 <- DEMA(ttrc[,"Close"], 20)
EMAR> evwma.20 <- EVWMA(ttrc[,"Close"], ttrc[,"Volume"], 20)
EMAR> zlema.20 <- ZLEMA(ttrc[,"Close"], 20)
EMAR> ## Example of Tim Tillson's T3 indicator
EMAR> T3 <- function(x, n=10, v=1) DEMA(DEMA(DEMA(x,n,v),n,v),n,v)
EMAR> t3 <- T3(ttrc[,"Close"])
EMAR> ## Example of short-term instability of EMA
EMAR> ## (and other indicators mentioned above)
EMAR> x <- rnorm(100)
EMAR> tail( EMA(x[90:100],10), 1 )
[1] 0.192859
EMAR> tail( EMA(x[70:100],10), 1 )
[1] 0.149217
EMAR> tail( EMA(x[50:100],10), 1 )
[1] 0.153751
EMAR> tail( EMA(x[30:100],10), 1 )
[1] 0.153703
EMAR> tail( EMA(x[10:100],10), 1 )
[1] 0.153703
EMAR> tail( EMA(x[ 1:100],10), 1 )
[1] 0.153703
R>
The News says it's now on CRAN. My Mac has 0.20-2 on it and the installer reports that to be the most recent. Loading seems to succeed and no errors from running a few examples.
Re the r-forge version 20-3 I get this:
install.packages("TTR", repos="http://R-Forge.R-project.org")
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘TTR’ is not available (for R version 2.13.0 beta)
R version 2.13.0 beta (2011-04-04 r55296) (not the latest)

Resources