1.getwd setwd
2.rm(list=ls())
3.ESC停止運行
3.n() n_distinct() 計數 不重復計數
5.View(top_counts) 看表格
6.mpg是dataframe str(mpg)看大致結構
7.快速輸出<- option+-
8.packageversion 查看包版本
9.ctrl shift c 多行注釋
錯誤:
1.unused arguments錯誤:其實是把參數拼寫錯了
stringsAsFactors (string+s)
2.同樣錯誤 ?函數發現確實兩個參數沒有。發現包的版本太低了。
3.安裝包失敗
tar: Failed to set default locale
Use this command in the R console:
system("defaults write org.R-project.R force.LANG en_US.UTF-8")
Remember to quit and start again R.
4.unable to find an inherited method for function ‘select’ for signature ‘"tbl_df"’
dplyr::select
1.R語言 函數
2.批量腳本
3.ggplot的theme中的標簽 圖例修改
4.mac添加路徑:注意在 ~/.bash_profile
rownames(mrnaList) <- mrnaList$Gene
Error inrow.names<-.data.frame
(*tmp*
, value = value) :
duplicate 'row.names' are not allowed
因為變量有重復的。所以不能作為rowname
rownames(mrnaList) = make.names(mrnaList$mRNA, unique=TRUE)
rstudio
ctrl+1 ctrl+2
packageVersion 查看軟件包的版本