官术网_书友最值得收藏!

Getting ready

Recall that you have created several R objects in the prior recipes, such as vector, matrix, data frame, and array. Now, you are in a position to create another single R object that could contain all the objects that you have already created and then want to access those as needed. To get ready for this recipe, let's re-run those lines of code and create those objects again:

    cVec <- c("Cricket", "Football", "Basketball", "Rugby")
nVec <- c(1:10)
Lvec <- c(TRUE, FALSE, FALSE, TRUE)
matA <- matrix(1, nrow=2, ncol=2)
datA <- data.frame(ID = 1:5, hourSpetOnInternet = c(5,3,4,1,2),
GENDER = c("M", "F", "F", "M", "F"))
arrayA <- array(1:16, dim=c(2,2,4))

In this recipe, you will organize these heterogeneous objects into a single R object that is called list.

主站蜘蛛池模板: 牡丹江市| 长宁县| 延川县| 汉寿县| 台南市| 郓城县| 那曲县| 伽师县| 兴业县| 兴业县| 靖西县| 潍坊市| 阳新县| 东安县| 淮安市| 兴化市| 论坛| 东乡族自治县| 河津市| 噶尔县| 麻江县| 秭归县| 靖江市| 平阴县| 乾安县| 屏山县| 宜兴市| 新宾| 连平县| 永登县| 武城县| 故城县| 西宁市| 岑溪市| 福建省| 河东区| 永嘉县| 德化县| 庆阳市| 西乌珠穆沁旗| 弥渡县|