排行榜

  • 用户榜
  • 标签榜
  • 冲榜分奖金

频道

最新最热悬赏待采纳 筛选
  • 0

    回答

  • 5

    浏览

我以前画图,不同变量不同颜色,R语言的默认颜色是红绿蓝紫,不知道从哪天开始,默认颜色变成了蓝绿黑渐变了,不知道有无大神告诉我改回去的方法???  

  • 3

    回答

  • 10

    浏览

用INSTALL_opts="--no-multiarch"下载了brms64位版本(根据可能的版本不适用);CPU可以执行AVX系列指令;电脑电源性能已调最大 这是版本信息

  • 1

    回答

  • 18

    浏览

这是什么意思

回答 Adashe
采纳率33.3%
昨天
  • 4

    回答

  • 22

    浏览

怎么让多个图的自定义坐标轴统一 if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") #调用biomanager BiocManager::install("Mfuzz") library("Mfuzz") gene <- read.table("compairing with 0d_FPKM.csv",header = T,row.names=1,sep=",") gene_tpm <- data.matrix(gene) eset <- new("ExpressionSet",exprs = gene_tpm) gene.r <- filter.NA(eset, thres=0.25) gene.f <- fill.NA(gene.r,mode="mean") tmp <- filter.std(gene.f,min.std=0) gene.s <- standardise(tmp) c <- 12 m <- mestimate(gene.s) cl <- mfuzz(gene.s, c = c, m = m) cl$size write.table(cl$cluster,"compairing with 0d_FPKM.csv",quote=F,row.names=T,col.names=F,sep=",") mfuzz.plot(gene.s,cl,mfrow=c(3,4),new.window= FALSE) mfuzz.plot(gene.s,cl,mfrow=c(3,4),new.window= FALSE) axis(1,at=c(1,2,3,4,5,6,7,8,9),labels=c("0_h","C1h","C3h","C6h","C12h","C1d","C3d","C7d","C28d")) 后面自定义了坐标轴,但只有最后一张图变了

  • 1

    回答

  • 8

    浏览

library(XLConnect) 错误: package or namespace load failed for ‘XLConnect’: loadNamespace()里算'XLConnect'时.onLoad失败了, 详细内容:调用: system2("cat", c("/etc/*-release"), stdout = TRUE, stderr = TRUE) 错误: '"cat"' not found  

回答 weixin_43817907
采纳率0%
2天前
  • 3

    回答

  • 35

    浏览

假设有一数据集: 可以通过什么方式整理数据为以下样子呢? (数字表示频数)

  • 0

    回答

  • 5

    浏览

语句不大会,希望可以知道用python读取rworkspace的方法

  • 3

    回答

  • 17

    浏览

我想做森林图,但生成的图中各变量被按照首字母重新排序了,有没有什么指令能让它不改变我的原始顺序呢

  • 4

    回答

  • 40

    浏览

hotel <- read.csv("D:/Download/评论.txt") segmentCN (hotel) edit(hotel) segmentCN("D:/Download/评论.txt") 前两行代码报错:Error in segmentCN(hotel) : Please input character! 第三行代码数据表 第四行代码结果:[1] "D"        "Download" "评论"     "txt"          问:为什么不能直接读取文件来分词?

  • 3

    回答

  • 25

    浏览

  请问一下我想在地图上根据各州的数量显示不同的颜色,但是我的图出来像下面那样只有澳大利亚整体地图并没有按不同的州显示,附上数据和图还有代码,有大佬知道怎么改吗,求问。     library(jsonlite) library(geojsonio) library(highcharter)   dtstates1 <- read_csv('states_homeless1.csv') ausgeojson <- GET("https://raw.githubusercontent.com/johan/world.geo.json/master/countries/AUS.geo.json") %>%   content() %>%   fromJSON(simplifyVector = FALSE) %>%   as.json() names(dtstates1) <- c("hc-key", "value") knitr::kable(head(dtstates1)) highchart(type = "map") %>%   hc_title(text = "Homeless in Australia ") %>%   hc_subtitle(text = "Homeless in Australia") %>%   hc_add_series(mapData =ausgeojson,                  showInLegend = TRUE,                 data = dtstates1,                     name = "region",                     value = "value",                     joinBy = c("hc-key", "value")) %>%   hc_mapNavigation(enabled = TRUE)%>%    hc_colorAxis(auxpar = NULL)         

  • 0

    回答

  • 4

    浏览

方便的话,麻烦举个例子,Rx

回答 LXW-90s
采纳率100%
7天前
  • 0

    回答

  • 13

    浏览

LLN <- function(m=300) {   y<-mapply(function(n)mean(sample(c(0,1),n,replace = T)),c(1:m))   x<-seq(1:m)   plot(x,y,type = 'l')   abline(h=0.5 col=3) }  

回答 展 缓
采纳率100%
7天前
  • 4

    回答

  • 17

    浏览

用arrange降序排序后是这样的,按位数从前到后比大小

  • 4

    回答

  • 13

    浏览

在安装GitHub上的 PStestR 包时,报错了,如下所示,求各位大神帮忙解决问题 E  creating vignettes (10.5s)    --- re-building 'PStestR.Rmd' using rmarkdown    Error: processing vignette 'PStestR.Rmd' failed with diagnostics:    The 'rmarkdown' package should be installed and declared as a dependency of the 'PStestR' package (e.g., in the 'Suggests' field of DESCRIPTION), because the latter contains vignette(s) built with the 'rmarkdown' package. Please see https://github.com/yihui/knitr/issues/1864 for more information.    --- failed re-building 'PStestR.Rmd'        SUMMARY: processing the following file failed:      'PStestR.Rmd'        错误: Vignette re-building failed.    停止执行 错误: Failed to install 'PStestR' from GitHub:   System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr (last 10 lines): E> --- re-building 'PStestR.Rmd' using rmarkdown E> Error: processing vignette 'PStestR.Rmd' failed with diagnostics: E> The 'rmarkdown' package should be installed and declared as a dependency of the 'PStestR' package (e.g., in the 'Suggests' field of DESCRIPTION), because the latter contains vignette(s) built with the 'rmarkdown' package. Please see https://github.com/yihui/knitr/issues/1864 for more information. E> --- failed re-building 'PStestR.Rmd' E>  E> SUMMARY: processing the following file failed: E>   'PStestR.Rmd' E>  E> 错误: Vignette re-building failed. E> 停止

  • 3

    回答

  • 13

    浏览

请问:我在使用Rstudio时,每次退出anaconda后再次进入,都需要重新安装(install)Rstudio。这是什么原因呢?anaconda中别的,如spyder并不存在这种问题。()

  • 0

    回答

  • 5

    浏览

power bi 导入数据CSV后,更新了,对源数据加了一列,源数据依旧存在原来的位置,覆盖之前的,然后选择最近的源数据 power BI 显示无法加载,随后选择重新获取数据还是无法加载,除非对更新后的数据重新选个不同的位置才可以。费解  

回答 月亮不吃饭
采纳率100%
9天前
  • 3

    回答

  • 23

    浏览

用R做中介效应分析,自变量是二分类变量,中介及因变量均为连续型变量,样本量3万。mediate指令可以顺利运行,但是使用medsens进行敏感性分析的时候报错 Error in m.coefs[T.out, ] : 下标出界,求各路大神指点一下,可能是什么错误。R语言初学者,这个错误代码英文是什么意思都不知道

  • 3

    回答

  • 12

    浏览

请问LMM模型中估计值(estimate)具体含义是什么呀,Y为因变量,假定A相较于B,estimate=0.1,P<0.05,那么该如何解读呢?我在操作过程中把A,B两组赋值换了一下,estimate绝对值没变,符号相反,想不通是为什么?求大神们指点一下,谢谢!

  • 3

    回答

  • 24

    浏览

library(swirl) Error: package or namespace load failed for ‘swirl’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):  there is no package called ‘bitops’ > install.packages("bitops")   There is a binary version available but the source version is later:        binary source needs_compilation bitops  1.0-6  1.0-7              TRUE Do you want to install from sources the package which needs compilation? (Yes/no/cancel)  installing the source package ‘bitops’ trying URL 'https://mirrors.e-ducation.cn/CRAN/src/contrib/bitops_1.0-7.tar.gz' Content type 'application/x-gzip' length 10809 bytes (10 KB) ================================================== downloaded 10 KB * installing *source* package ‘bitops’ ... ** package ‘bitops’ successfully unpacked and MD5 sums checked ** using staged installation ** libs xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun ERROR: compilation failed for package ‘bitops’ * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/bitops’ The downloaded source packages are in     ‘/private/var/folders/9t/mjy2f0ds26d5ttj00_ct2rqm0000gn/T/RtmpdKR5zE/downloaded_packages’ Warning message: In install.packages("bitops") :   installation of package ‘bitops’ had non-zero exit status 下载安装完swirl包后,加载swirl包后提示缺少bitops 选择安装bitops包后,提示出错,求大神解决一下,谢谢!

  • 4

    回答

  • 19

    浏览

#install.packages("survival") #install.packages("forestplot") library(survival) library(forestplot) setwd("D:\\BaiduNetdiskDownload\\98panCancer\\09.cox")                       #设置工作目录 rt=read.table("expTime.txt",header=T,sep="\t",check.names=F,row.names=1)    #读取输入文件 rt$futime=rt$futime/365 gene=colnames(rt)[3] #对肿瘤类型进行循环 outTab=data.frame() for(i in levels(rt[,"CancerType"])){     rt1=rt[(rt[,"CancerType"]==i),]     cox=coxph(Surv(futime, fustat) ~ rt1[,gene], data = rt1)     coxSummary = summary(cox)     coxP=coxSummary$coefficients[,"Pr(>|z|)"]     outTab=rbind(outTab,                  cbind(cancer=i,                        HR=coxSummary$conf.int[,"exp(coef)"],                        HR.95L=coxSummary$conf.int[,"lower .95"],                        HR.95H=coxSummary$conf.int[,"upper .95"],                        pvalue=coxP) ) } write.table(outTab,file="cox.result.txt",sep="\t",row.names=F,quote=F)    #输出基因和p值表格文件 ############绘制森林图函数############ bioForest=function(coxFile=null,forestFile=null,forestCol=null){     #读取输入文件     rt=read.table(coxFile,header=T,sep="\t",row.names=1,check.names=F)     data=as.matrix(rt)     HR=data[,1:3]     hr=sprintf("%.3f",HR[,"HR"])     hrLow=sprintf("%.3f",HR[,"HR.95L"])     hrHigh=sprintf("%.3f",HR[,"HR.95H"])     pVal=data[,"pvalue"]     pVal=ifelse(pVal<0.001, "<0.001", sprintf("%.3f", pVal))     clrs <- fpColors(box=forestCol,line="darkblue", summary="royalblue")      #定义颜色     tabletext <-        list(c(NA, rownames(HR)),            append("pvalue", pVal),            append("Hazard ratio",paste0(hr,"(",hrLow,"-",hrHigh,")")) )   #定义图片文字     pdf(file=forestFile,width = 9,height = 6,onefile = FALSE)     forestplot(tabletext,                 rbind(rep(NA, 3), HR),                col=clrs,                graphwidth=unit(50, "mm"),                xlog=T,                lwd.ci=4,                boxsize=0.6,                xlab="Hazard ratio",                txt_gp=fpTxtGp(ticks=gpar(cex=1.1),xlab=gpar(cex = 1.25))                )     dev.off() } ############绘制森林图函数############ bioForest(coxFile="cox.result.txt",forestFile="forest.pdf",forestCol="red") 但运行出来的文件是空的,错误提示是:Error in read.table(coxFile, header = T, sep = "\t", row.names = 1, check.names = F) :    no lines available in input

  • 3

    回答

  • 68

    浏览

错误: package or namespace load failed for ‘org.Hs.eg.db’:  loadNamespace()里算'org.Hs.eg.db'时.onLoad失败了,详细内容:   调用: l$contains   错误: $ operator is invalid for atomic vectors

  • 0

    回答

  • 10

    浏览

我的目标是在不使用library的情况下为每个点找到与另一组数据对应的一个点的最小距离,并将名称附加到点数据中(显然是最小的),并使此过程自动进行。

  • 0

    回答

  • 5

    浏览

R3.6版本 windows10系统 在使用R进行并行时无限期挂起,代码如下 cl <- parallel::makeCluster(1) 使用future包观察建立并行的过程 cl <- future::makeClusterPSOCK(1,outfile = NULL, verbose = TRUE) 输出结果如下 [local output] Workers: [n = 1] ‘localhost’ [local output] Base port: 11025 [local output] Creating node 1 of 1 ... [local output] - setting up node [local output] - attempt #1 of 3 Testing if worker's PID can be inferred: ‘"D:/Program Files/R-3.6.3/bin/x64/Rscript" -e "try(suppressWarnings(cat(Sys.getpid(),file=\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac84217b7.pid\")), silent = TRUE)" -e "file.exists(\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac84217b7.pid\")"’ - Possible to infer worker's PID: FALSE [local output] Starting worker #1 on ‘localhost’: "D:/Program Files/R-3.6.3/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "try(suppressWarnings(cat(Sys.getpid(),file=\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac84217b7.pid\")), silent = TRUE)" -e "workRSOCK <- tryCatch(parallel:::.slaveRSOCK, error=function(e) parallel:::.workRSOCK); workRSOCK()" MASTER=localhost PORT=11025 OUT= TIMEOUT=2592000 XDR=FALSE [local output] - Exit code of system() call: 0 [local output] Waiting for worker #1 on ‘localhost’ to connect back [local output] - Detected 'outfile=NULL' on Windows: this will make the output from the background worker visible when running R from a terminal, but it will most likely not be visible when using a GUI. Failed to launch and connect to R worker on local machine ‘localhost’ from local machine ‘DESKTOP-GOVRM84’. * The error produced by socketConnection() was: ‘reached elapsed time limit’ (which suggests that the connection timeout of 120 seconds (argument 'connectTimeout') kicked in) * The localhost socket connection that failed to connect to the R worker used port 11025 using a communication timeout of 2592000 seconds and a connection timeout of 120 seconds. * Worker launch call: "D:/Program Files/R-3.6.3/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "try(suppressWarnings(cat(Sys.getpid(),file=\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac84217b7.pid\")), silent = TRUE)" -e "workRSOCK <- tryCatch(parallel:::.slaveRSOCK, error=function(e) parallel:::.workRSOCK); workRSOCK()" MASTER=localhost PORT=11025 OUT= TIMEOUT=2592000 XDR=FALSE. * Failed to kill local worker because it's PID is could not be identified. * Troubleshooting suggestions: - Suggestion #1: On Windows, to see output from worker, set 'outfile=NULL' and run R from a terminal (not a GUI). [local output] - waiting 15 seconds before trying again [local output] - attempt #2 of 3 Testing if worker's PID can be inferred: ‘"D:/Program Files/R-3.6.3/bin/x64/Rscript" -e "try(suppressWarnings(cat(Sys.getpid(),file=\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac4e5aba6.pid\")), silent = TRUE)" -e "file.exists(\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac4e5aba6.pid\")"’ - Possible to infer worker's PID: FALSE [local output] Starting worker #1 on ‘localhost’: "D:/Program Files/R-3.6.3/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "try(suppressWarnings(cat(Sys.getpid(),file=\"C:/Users/lenovo/AppData/Local/Temp/RtmpIjTjff/worker.rank=1.parallelly.parent=10668.29ac4e5aba6.pid\")), silent = TRUE)" -e "workRSOCK <- tryCatch(parallel:::.slaveRSOCK, error=function(e) parallel:::.workRSOCK); workRSOCK()" MASTER=localhost PORT=11025 OUT= TIMEOUT=2592000 XDR=FALSE [local output] - Exit code of system() call: 0 [local output] Waiting for worker #1 on ‘localhost’ to connect back 发现Waiting for worker #1 on ‘localhost’ to connect back会停留在该步骤,也就是说说无法与本地的localhost建立连接,本地对该请求没有反应,奇怪的是在一天前还是可以正常使用的,可以确定不是内存不足的原因

  • 3

    回答

  • 20

    浏览

1.想用基于bootstrap的ks检验判断两个物种累积经验分布函数是否具有差异性显著 2.基于bootstrap的ks检验判断模型拟合效果 详细描述如图  看了ks.boot()和ks.test()的帮助文件也没有理解并实现 请各位大佬指教  

  • 0

    回答

  • 6

    浏览

请问s-plus有arima模型代码吗,R软件里有可以拟合的garch-M模型的代码吗,能否用rugarch拟合,谢谢

回答 POKEMONKENG
采纳率0%
16天前
  • 2

    回答

  • 20

    浏览

是我的代码:read.table(file = 'mRNAmatrix.txt',header = T,row.names = 1)

  • 0

    回答

  • 9

    浏览

#这是只编了前插的一部分 N.Diff<-function(x,f,X){   k<-length(x)           #定义节点个数   answer<-0              #定义结果初始值   CFt<-matrix(NA,k,k)  #定义差分表   if(abs(X-x[1])<=abs(X-x[k])){      #向前差分     t<-(X-x[1])/(x[2]-x[1])      #定义间距     CFt[i,1]<-f[i]    #差分表第一列为f     for(j in 2:k){       for(i in 1:k){        if (i+j>(k+1)) break         CFt[i,j]<-CFt[i+1,j-1]-CFt[i,j-1]    #差分表的元素         }       }     lc<-rep(1,k);cf<-rep(0,k)     for(j in 2:k) {lc[j]<-prod(t-0:(j-2))/prod(1:(j-1))}    #定义连乘式     for(j in 1:k) {cf[j]<-CFt[1,j]}      Nn<-cf%*%lc     list(CFTable=CFt,Nnx=Nn)}}   x<-seq(0,0.5,by=0.1) f<-c(1,0.995,0.98007,0.95534,0.92106,0.87758) X<-0.048 N.Diff(x,f,X)   但是显示找不到对象,想问问是为什么,具体哪里出了问题