weixin_45021348 2021-01-12 08:45 采纳率: 0%
浏览 351

有没有会R语言的大神,帮忙看一下这段代码为什么显示参数有错误

> #install.packages("colorspace")
> #install.packages("stringi")
> #source("http://bioconductor.org/biocLite.R")
> #biocLite("DOSE")
> #biocLite("clusterProfiler")
> #biocLite("pathview")

> setwd("C:\\Users\\sdkj\\Desktop\\HYZtcmsp\\13.GO")
> library("clusterProfiler")

Registered S3 method overwritten by 'enrichplot':
  method               from
  fortify.enrichResult DOSE
clusterProfiler v3.14.2  For help: https://guangchuangyu.github.io/software/clusterProfiler

If you use clusterProfiler in published research, please cite:
Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.
> library("org.Hs.eg.db")
> rt=read.table("id.txt",sep="\t",header=T,check.names=F)
> rt=rt[is.na(rt[,"entrezID"])==F,]

> cor=rt$logFC
> gene=rt$entrezID
> names(cor)=gene

> #GO富集分析
> kk <- enrichGO(gene = gene,OrgDb = org.Hs.eg.db, pvalueCutoff =0.05, qvalueCutoff = 0.05)
> write.table(kk,file="GO.txt",sep="\t",quote=F,row.names = F)

> #柱状图
> tiff(file="barplot.tiff",width = 35,height = 20,units ="cm",compression="lzw",bg="white",res=600)
> barplot(kk, drop = TRUE, showCategory =20)
Error in farver::decode_colour(colors, alpha = TRUE, to = "lab", na_value = "transparent") : 
  参数没有用(na_value = "transparent")

> dev.off()
null device 
          1 

> #点图
> tiff(file="dotplot.tiff",width = 35,height = 20,units ="cm",compression="lzw",bg="white",res=600)
> dotplot(kk,showCategory = 20)
Error in farver::decode_colour(colors, alpha = TRUE, to = "lab", na_value = "transparent") : 
  参数没有用(na_value = "transparent")

> dev.off()
null device 
          1 




参数没有用是啥意思?

  • 写回答

1条回答 默认 最新

  • hbcqg712 2023-11-19 18:08
    关注

    这个错误提示的意思是你的代码试图使用一个没有定义的参数。在你的代码中,这个问题出现在你尝试使用farver::decode_colour函数时,其中的参数na_value = "transparent"并没有被正确地使用。

    farver::decode_colour函数是farver包的decode_colour函数的别名。这个函数主要用于将R中的颜色编码解码为人类可读的颜色。然而,你的代码中na_value = "transparent"这个参数并不能被farver::decode_colour函数识别,也就是说,这个函数并不接受这个参数。

    在你的代码中,问题可能出现在你试图在barplot和dotplot函数中使用farver::decode_colour函数的地方。你可能需要检查你的包版本是否正确,或者你是否正确地使用了这些函数。

    首先,你需要确认你已经正确地安装了所有需要的包,包括clusterProfiler、org.Hs.eg.db和farver。然后,你需要确认你的包版本是最新的,特别是farver包,因为在旧的版本中可能存在一些已知的问题。

    如果你确认你的包版本都是最新的,那么你需要检查你的代码是否正确地使用了这些函数。例如,你可能需要检查你是否正确地提供了每个函数的参数,或者你是否试图使用一个并不存在的参数。

    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容