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

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.

主站蜘蛛池模板: 囊谦县| 云林县| 茶陵县| 滨海县| 曲沃县| 同德县| 巴中市| 金寨县| 满城县| 许昌市| 维西| 桂阳县| 二连浩特市| 山东| 醴陵市| 山阳县| 诏安县| 玉林市| 土默特左旗| 正阳县| 开远市| 饶河县| 嘉鱼县| 元朗区| 海阳市| 全州县| 奇台县| 阳信县| 揭阳市| 阳谷县| 陵川县| 磴口县| 精河县| 客服| 晋中市| 涞水县| 凤城市| 蒲江县| 思南县| 松潘县| 天柱县|