找不到库文件

/usr/bin/ld: cannot find -llapack /usr/bin/ld: cannot find -lblas sudo apt-get install libblas-dev liblapack-dev ERROR: configuration failed for package ¡®XML¡¯ * removing ¡®/home/user/R/x86_64-pc-linux-gnu-library/3.5/XML¡¯ sudo apt-get install libxml2-dev Error, nc-config not found or not executable. This is a script that comes with the netcdf library, version 4.1-beta2 or later, and must be …

常见问题

https://community.rstudio.com/t/biobase-not-available-for-r-version-3-5-1/17761 ΔBiobase not available for R version 3.5.1 should first install the BiocManager package install.packages(“BiocManager”) BiocManager::install(“phyloseq”, version = “3.8”) Δchecking whether pkg-config knows about cairo… no Cannot find cairo.h! you need the cario dev files apt-get install libcairo2-dev I also needed to install the following apt-get install libxt-dev Δ设置 Bioconductor …

Rstudio修改默认library安装位置

查找下在 /usr/lib/R/etc/ 下的 Renviron 文件中。找到这一行 R_LIBS_SITE=${R_LIBS_SITE-‘/home/user/Archive/software/R/x86_64-pc-linux-gnu-library/3.0/:/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library’} 当然上面包含XXX的路径修改成你希望的存储目录即可。 修改之后的再次在R中运行 libPaths() 命令的结果是: > .libPaths() [1] “/home/user/Archive/software/R/x86_64-pc-linux-gnu-library/3.0” [2] “/usr/local/lib/R/site-library” [3] “/usr/lib/R/site-library” [4] “/usr/lib/R/library”  

几个命令

取txt文件值 data=read.table(“1.txt”,header=T) 读值 head(data) windows下 获取当前工作目录 getwd() 相对路径 setwd(“.\\Rsourse”) 上一级目录 setwd(“..\\”) 绝对路径 setwd(“D:\\MySpace\\机器学习\\R\\Rsourse”)  

使用R语言导入不同格式的文件

假如我们要导入C:\Users\user\Desktop路径下的test.csv文件,则输入代码: read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”) 默认情况下,R语言会认为第一行的是数据的标题,假如你的数据的第一行其实并不是标题,那么可以输入代码: read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”,header = F) 下面的代码会将数据赋给对象Mydata: Mydata<-read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”,header = F) 要查看Mydata对象里的数据,直接输入Mydata就可以了: Mydata 原始txt数据中有a、b两列数据,并且它们以“;”号作为分隔符,则: read.table(file = “C:\\Users\\user\\Desktop\\test.txt”,header = T,sep=”;”) 假如分隔符是其他符号,例如百分号“%”,则代码修改为: read.table(file = “C:\\Users\\user\\Desktop\\test.txt”,header = T,sep=”%”)