R语言read.csv()读入行不规则数据

R语言read.csv()读入行不规则数据出错

> csv4=read.csv("CondenOriginal.csv")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'CondenOriginal.csv': No such file or directory
  1. 将准备读入的不规则数据进行复制。
  2. 新建csv表格,选中全部区域后,选择性粘贴,点击转置。
  3. 转置后,行和列转换,数据可以被读入:
  4. > csv2=read.csv("ConO.csv")
  5. 任务是找出每行中“1”的数量,统计后做出波形图显示规律。

csv2=read.csv(“ConO.csv”)
cod1=t(csv2)
colLineNum=nrow(cod1)
for(j in 1:colLineNum)
{
write.table(sum(cod1[,j]),“result1.csv”,append=TRUE,
sep=",",col.names = FALSE,row.names = FALSE)

cop=read.csv(“result1.csv”)
x1=c(1:57)
plot(x1,cop[,1],type =“l”,col=“red”,main = “haha”)`

  1. 结果如下:
    在这里插入图片描述

在这里插入图片描述