开根号
- sqrt()
- 取对数用log(),差分用diff(),开根号用sqrt()
Error 1
Error in make.names(col.names, unique = TRUE) :
invalid multibyte string at ‘<4e>’
In addition: Warning messages:
1: In read.table(“exam0203.txt”, head = TRUE) :
line 1 appears to contain embedded nulls
Sol.1
根据警告信息分析,最后一行不正确。
有可能你的EXCEL末尾有空白内容填充的单元格,转换为CSV后有空白的没有数据的行。
解决方法尝试:用记事本打开CSV,将数据末尾后面的所有空白信息删除。
把双斜杠改成单斜杠试试吧
因编码导致的R读取数据错误
如果是Unicode, read.table时会报错
“错误于make.names(col.names, unique = TRUE) :
多字节字符串不对"
改成ANSI编码后, 问题解决.
如何判断文件的编码格式
可以采用notepad++来查看 This is the most possiable way
Error2
> source(“D:\R working\exam0203.R”)
Error in file(file, “rt”) : cannot open the connection
Sol.1
1、设定工作目录:
setwd(“d:/”) 搜索
然后把 txt放在d 盘根目录下,用 read.table读取
2、直接把路径带入读入 read.table(“d:/exam0203.txt”, header=T)
其余的就都解决了吧
向量的加、减、乘、除、“乘方 ”
求n个相同因数乘积的运算,叫做乘方 involution; power,乘方的结果叫做幂(power)。
其中, a叫做底数(base number) ,n叫做指数 (exponent),当a^n 看作a的 n次方的结果时,也可读作“ a的n 次幂”。
一个数都可以看作这个本身数的一次方。指数 1通常省略不写。
.
.
.
2019-03-27 11:11:55写于浦东图书馆