学习小组Day5笔记--未停

基础知识

  • R的赋值<-
  • R的代码都是带英文括号
  • 表格在R语言中叫数据框
  • ?read.table,调出相应函数的帮助文档,翻到example部分研究一下。或者直接网页搜索你不会的函数。

标量与向量的区分

微信图片_20200328072141.png

向量的赋值与提取

图片.png

数据框

  • 导入read.table(file = "huahua.txt",sep = "\t",header = T);x<-read.csv("doudou.txt")
  • 列名colnames(X)
  • 行名rownames(X)
  • 导出write.table(X,file = "yu.txt",sep = ",",quote=F)
  • 保存save.image(file="bioinfoplanet.RData")#保存当前所有变量
    save(X,file="test.RData")#保存其中一个变量
  • 加载load("test.RData")#再次使用RData时的加载命令


    图片.png

    图片.png
  • 提取元素


    图片.png

    图片.png

    图片.png

含义

header
a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns.
sep
the field separator character. Values on each line of the file are separated by this character. If sep = "" (the default for read.table) the separator is ‘white space’, that is one or more spaces, tabs, newlines or carriage returns.
quote
the set of quoting characters. To disable quoting altogether, use quote = "". See [scan](http://127.0.0.1:44515/help/library/utils/help/scan) for the behaviour on quotes embedded in quotes. Quoting is only considered for columns read as character, which is all of them unlesscolClasses is specified.

问题

save(X,file="test.RData")这句代码如果报错X not found,是为什么,应该怎么解决?
X数据没有保存或者提取出来,重新读X这个数据或者重新提取X。

xmind

图片.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,504评论 0 13
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,934评论 0 0
  • 今天是21天写作训练营的第一天,我很高兴也很激动而且很感动。总之此刻的心情很微妙,不知道用什么样的言语来表达出来。...
    感恩自然阅读 624评论 5 2
  • 来到北京也快一个月了,连这里的秋天都与成都不同。 热得发指的白昼却能在夜里看到明亮的北斗,冷漠到无情的校友却能在操...
    五十一_797d阅读 127评论 0 1
  • 在1974年时候,我们村有刚结婚的年青人,都比较开朗,有一次丈母娘过来的时候,正在下雨,衣服已经淋湿了,她女儿把她...
    36c6d2d3fef6阅读 70评论 0 0