r数据框计算字符出现次数_R语言总结(上)18

第一章

Listing 1.1 - A Sample R session

Listing 1.2 - An example of commands used to manage

Listing 1.3 - Working with a new package

在这一章中我学会了:简单的R语言操作,R包的下载,help()帮助命令??和?的操作作用

第二章   创建基本的数据类型

Listing 2.1 - Creating Matrices(矩阵)

Listing 2.2 - Using matrix subscripts(矩阵下标)

Listing 2.3 - Creating an array(数组)

Listing 2.4 - Creating a dataframe(数据框)

Listing 2.5 - Specifying elements of a dataframe(指定数据框的元素)

 Listing 2.6 - Using factors(使用因子)

Listing 2.7 - Creating a list(列表)

在这一章中我学会了:

第三章 “Hmisc“包的使用

Listing 3.1 - Using graphical parameters to control(图形参数的控制)

Listing 3.2 - An Example of Custom Axes(轴)

Listing 3.3 - Comparing Drug A and Drug B response by dose(剂量对A和B药物反应的比较)

Listing 3.4 - Fine placement of figures in a graph(图中的精确位置)

在这一章中我学会了:lm(构建线性函数)、rainbow(调色板,可以使得拥有很多颜色)、开始对应opar

第四章

Listing 4.1 - Creating the leadership data frame(创建一个数据框)

Listing 4.2 - Creating new variables(创建一个新变量)

Listing 4.3 -Recoding variables(重新编码变量)

Listing 4.4 -Renaming variables with the reshape package(使用resheme包重命名变量)

Listing 4.5 - Converting from one data type to another(从一种数据类型转换为另一种数据类型)

Listing 4.6 - Selecting Observations(选择观察结果)

Listing 4.7 - Using SQL statements to manipulate data frames(使用SQL语句操作数据帧)【不懂】

在这一章中我学会了:(data.frame创建数据框)、(rm函数表示移除的意思)、对于函数执行公式化会更加简单些、mydata$sumx

第五章

Listing 5.1 -  Calculating the mean and standard deviation(平均值和标准差)

Listing 5.2 - Generating pseudo-random numbers from  a uniform distribution(从均匀分布生成伪随机数)

Listing 5.3 - Generating data from a multivariate normal distribution(从多元正态分布生成数据)

Listing 5.4 - Applying functions to data objects(将函数应用于数据对象)

Listing 5.5 - Applying a function to the rows (columns) of a matrix(对矩阵的行(列)应用函数)

Listing 5.6 - A solution to the learning example(学习示例的解决方案)

Listing 5.7 - A switch example(转换示例)

Listing 5.8 - mystats(): a user-written function for summary statistics(一个用户编写的用于摘要统计的函数)

Listing 5.9 - Transposing a dataset(转换数据集)

在这一章中我学会了:length(返回字符数量)、rnorm随机正态分布、mvrnorm多元随机正态分布、head(查数据前六行)、trim=  表示去极端值、scale(中心化标准化)、stringAsFactor=FALSE表示不变成属性数据按字符串读入、strsplit()函数表示字符串分割、sapply()函数表示提取每个成分的第一个元素、*|或、&且、!非、if(){()}很多命令的书写形式、转置函数,将行列进行转换t()、aggregate(x,by,FUN,na.rm=TRUE)(数据框、按照哪些变量进行分类、对分类的数据进行怎样的操作)。

第六章

Listing 6.1 - Simple bar plot(简单的柱状图)

Listing 6.2 - Stacked and groupde bar plots(堆积条形图和分组条形图)

Listing 6.3 - Mean bar plots(均值条形图)

Listing 6.4 - Fitting labels in bar plots(条形图拟合标签)

Listing 6.5 - Pie charts(饼图)

Listing 6.6 - Histograms(直方图)

Listing 6.7 - Kernel density plot(概率密度图)

Listing 6.8 - Comparing kernel density plots(比较内核密度图)

Listing 6.9 - Box plots for two crossed factors(两个交叉因子箱型图)

Listing 6.10 - Violin plots(小提琴图)

在这一章中我学会了:barplot()函数绘制直方柱状图,参数(main、线缆、预览、horiz=TRUE、从来、legend、beside=TRUE)、name.arg(字体斜着显示)、table()统计因子水平的出现次数(频数或频率)、pie3D(数据,explode=各块之间的间隔、main=)绘制3D饼图、density(数据)概率密度函数、sm.dentisity.compare(比较项,因子,xlab=)、boxplot(数据~因子,notch=TRUE带有切口的箱型图、col=,add=TRUE 叠加到上一幅图上吗?)、vioplot(三个变量哟)小提琴图。

第七章

Listing 7.1 - descriptive stats via summary(描述性统计)

Listing 7.2 - descriptive stats via sapply(描述性统计)

Listing 7.3 - Descriptive statistics (Hmisc package)(描述性统计)

Listing 7.4 - Descriptive statistics (pastecs package)(描述性统计)

Listing 7.5 - Descriptive statistics (psych package)(描述性统计)

Listing 7.6 - Descriptive statistics by group with aggregate(分组的描述性统计)

Listing 7.7 - Descriptive statistics by group via by(按组进行描述性统计)

Listing 7.8 Summary statists by group (doBy package)(按组汇总统计信息)

Listing 7.11 - Two-way table using CrossTable(双向表)

Listing 7.12 - Three-way contingency table(三向表)

Listing 7.13 - Chis-square test of independence(独立性的卡方检验)

Listing 7.14 - Measures of association for a two-way table(双向表的关联度量)

Listing 7.15 - converting a table into a flat file via table2flat(将表转换为平面文件)

Listing 7.16 - Using table2flat with published data()

Listing 7.17 - Covariances and correlations(协方差和相关)

Listing 7.18 - Testing correlations for significance(相关性的重要性)

Listing 7.19 - Correlation matrix and tests of significance via corr.test(相关矩阵和通过corr.test进行的重要性检验)

在这一章中我学会了:不同方式进行描述性统计、with()函数提取数据框中的某些参数、margin.table()按行进行计数、prop.table()按行计百分比、prop.table ()行列合计求百分比、addmargins()对计数结果进行列求和、CrossTable()列连表、xtabs()三连表,其中对于变量可以进行公式上的计算、assocstats()函数计算关联度(二维列表)、npmc()同步进行多组比较。

第八章

Listing 8.1 - simple linear regression(简单线性回归)

Listing 8.2 - Polynomial regression(多项式回归)

Listing 8.3 - Examining bivariate relationship(检查双变量关系)

Listing 8.4 - Multiple linear regression(多元线性回归)

Listing 8.5 Multiple linear regression with a significant(具有显着性的多元线性回归)

Listing 8.6 Function for plotting studentized residuals(残差图)

Listing 8.7 - Assessing homoscedasticity(评估均方差)

Listing 8.8 - Global test of linear model assumptions(线性模型假设的整体检验)

Listing 8.9 - Evaluating multi-collinearity()

Listing 8.10 - Box-Cox Transformation to normality()

Listing 8.11 - Comparing nested models using the anova function()

Listing 8.12 - Comparing models with the Akaike Information Criterion

Listing 8.13 - Backward stepwise selection(向后逐步选择)

Listing 8.14 - All subsets regression

Listing 8.15 - Function for k-fold cross-validated R-square

在这一章中我学会了:lm()拟合线性回归函数、residuals()计算回归方程残差、effects包可以用图形显示交互结果、中的effect()函数可以查看不同类型的均值、qqplot()提供更为精确地正态假设检验方法、car包中的函数可以评估方差齐性、其他的你清楚你想要何种结果,照着代码打就可以了。

总体感受,1-8章,为了完成赌约,在deadline前的一星期完成了,一开始的时候感觉难度不是很大,学得很是激动,越到后来,代码的难度上来了,尤其涉及到了一些统计知识了,就产生了厌学,不过还好,现在已经重新打起精神学起来,加油呀,其实学完前八章的这段时间很是迷茫,没有了一开始的斗志,但是今年,这个月又要过去了,应该好好地努力过好每一天才是。

cad3dc759c2180c0fd32cd6a5beecd73.png

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值