方法一:安装xlsx包

image.png
image.png

  1. install.packages("xlsx")
  2. library(xlsx)
  3. #取出excel(2020-11-29zlin_IL33_TGFb1.xls)工作簿的工作表Results,存为.csv
  4. results = read.xlsx(file = "2020-11-29zlin_IL33_TGFb1.xls","Results",
  5. startRow = 38,endRow = 135,header = TRUE)

如果安装报错
image.png

方法二:提示你的电脑没安装java,可以安装提示访问java官网安装,或者从另外一个包“readxl”读取

  1. library(readxl)
  2. rea = read_excel("2020-12-13zlin_qPCR_18S-TNFa.xls","Results")
  3. # read_excel没有header参数
  4. ?read_excel查看用法,如下
  1. read_excel(path, sheet = NULL, range = NULL, col_names = TRUE,
  2. col_types = NULL, na = "", trim_ws = TRUE, skip = 0,
  3. n_max = Inf, guess_max = min(1000, n_max),
  4. progress = readxl_progress(), .name_repair = "unique")
  5. read_xls(path, sheet = NULL, range = NULL, col_names = TRUE,
  6. col_types = NULL, na = "", trim_ws = TRUE, skip = 0,
  7. n_max = Inf, guess_max = min(1000, n_max),
  8. progress = readxl_progress(), .name_repair = "unique")
  9. read_xlsx(path, sheet = NULL, range = NULL, col_names = TRUE,
  10. col_types = NULL, na = "", trim_ws = TRUE, skip = 0,
  11. n_max = Inf, guess_max = min(1000, n_max),
  12. progress = readxl_progress(), .name_repair = "unique")

方法三:安装了包以后,是在不懂代码,还可以这样读取,前提是安装了包

image.png出现以下界面

image.png
接着
Snipaste_2021-01-10_11-39-25.png
成功的界面
Snipaste_2021-01-10_11-42-45.png