rds转成csv
在R下,依次输入如下代码:
data <- readRDS(file = '/文件路径') # 左斜线
write.table(data, file = '文件名称.csv', sep = ',', quote = F, row.names = F)
之后就可以在python中进行正常的csv文件操作方式了,见本人其他博客。
报错:cannot coerce class ‘structure(“dgCMatrix”, package = “Matrix”)’ to a data.frame
Just convert to matrix first:
data <- as.matrix(data)
as.data.frame(t(data))