环境设置函数为options(),用options()下令可以设置一些环境变量,利用help(options)可以检察具体的参数信息。
1. 检察默认参数:
names(options()) [1] "add.smooth" "ambiguousMethodSelection" "askpass" [4] "asksecret" "BioC" "bitmapType" [7] "browser" "browserNLdisabled" "buildtools.check" [10] "buildtools.with" "callr.condition_handler_cli_message" "CBoundsCheck" [13] "check.bounds" "citation.bibtex.max" "connectionObserver" [16] "continue" "contrasts" "cpp11_preserve_xptr" [19] "cpp11_should_unwind_protect" "datatable.alloccol" "datatable.allow.cartesian" [22] "datatable.auto.index" "datatable.dfdispatchwarn" "datatable.optimize" [25] "datatable.print.class" "datatable.print.colnames" "datatable.print.keys" [28] "datatable.print.nrows" "datatable.print.rownames" "datatable.print.topn" [31] "datatable.print.trunc.cols" "datatable.use.index" "datatable.verbose" [34] "datatable.warnredundantby" "defaultPackages" "demo.ask" [37] "deparse.cutoff" "deparse.max.lines" "device" [40] "device.ask.default" "digits" "download.file.method" [43] "dplyr.show_progress" "dvipscmd" "echo" [46] "editor" "encoding" "error" [49] "example.ask" "expressions" "foreachDoparLocal" [52] "ggvis.renderer" "help_type" "help.search.types" [55] "help.try.all.packages" "HTTPUserAgent" "httr_oauth_cache" [58] "httr_oob_default" "install.packages.compile.from.source" "internet.info" [61] "keep.parse.data" "keep.parse.data.pkgs" "keep.source" [64] "keep.source.pkgs" "locatorBell" "mailer" [67] "matprod" "matrixStats.center.onScalar" "matrixStats.vars.formula.freq" [70] "matrixStats.vars.formula.onMistake" "max.print" "menu.graphics" [73] "mgcv.vc.logrange" "na.action" "nwarnings" [76] "OutDec" "page_viewer" "pager" [79] "papersize" "pboptions" "CRE_limit_recursion" [82] "CRE_study" "CRE_use_JIT" "pdfviewer" [85] "pkgType" "plumber.docs.callback" "plumber.swagger.url" [88] "printcmd" "profvis.keep_output" "profvis.print" [91] "profvis.prof_extension" "profvis.prof_output" "progressr.clear" [94] "progressr.enable" "progressr.enable_after" "progressr.interrupt.message" [97] "progressr.interrupts" "progressr.interval" "progressr.lifecycle.progress" [100] "progressr.times" "prompt" "readr.show_progress" [103] "repos" "restart" "reticulate.initialized" [106] "reticulate.repl.busy" "reticulate.repl.hook" "reticulate.repl.initialize" [109] "reticulate.repl.teardown" "rl_word_breaks" "rsconnect.check.certificate" [112] "rstudio.notebook.executing" "RStudioGD.antialias" "RStudioGD.backend" [115] "scipen" "Seurat.checkdots" "Seurat.coords.short_range" [118] "Seurat.input.sparse_ratio" "Seurat.limma.wilcox.msg" "Seurat.memsafe" [121] "Seurat.Rfast2.msg" "Seurat.warn.umap.uwot" "Seurat.warn.vlnplot.split" [124] "shiny.launch.browser" "shinygadgets.showdialog" "show.coef.Pvalues" [127] "show.error.messages" "show.signif.stars" "str" [130] "str.dendrogram.last" "stringsAsFactors" "terminal.manager" [133] "texi2dvi" "timeout" "ts.eps" [136] "ts.S.compat" "unzip" "useFancyQuotes" [139] "verbose" "viewer" "warn" [142] "warning.length" "width" 检察默认参数的默认设置getOption()
getOption("stringsAsFactors")[1] FALSEgetOption("Seurat.checkdots")[1] "warn"检察全部默认参数的设置
sapply(names(options()),getOption)默认参数的更改
options(stringsAsFactors = "TRUE")getOption("stringsAsFactors")[1] "TRUE"2. 一些常见的options设置
options(repr.plot.height=10, repr.plot.width=10)VlnPlot(pbmc,features = c("nCount_RNA","nFeature_RNA","percent.mito"),pt.size = 0,ncol=1)拼图之前,先要根据自己图片的张数,设置好画布巨细,这很告急。一样平常一张方形的图会设置为width和height都即是5,如果两张横着拼在一起,就会设画布为10*5;如果拼6张图,一行三张,则设为15*10,以此类推。当然绘图的时间也可以自己实验,根据现实环境调解。
repr.plot.height和repr.plot.width设置了整张图的巨细
参考:https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/options |