


![How to handle list in R 4 a=c(2,3,4) output : 2 3 4 b=(“ab”,”bc”,”ef”) d=c(True,False) list(a,b,d) lst_1=list(abd) lst_1[[1]] lst_1[[1]] [1] Lst_1[[2]][3]=“xy” “ab” ”bc” ”xy”](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-4-2048.jpg)
![How to handle matrices in R 5 matr=matrix(c(1,2,3,4,5,6),nrow=3,ncol=2,byrow=F) 1 4 matr 2 5 3 6 matr[,1] matr[1,] matr[1,1] matr=cbind(matr,c(3,5,7)) ?cbind matr=rbind(matr,c(3,5,7)) dimnames(matr)=list(c(”r1”,”r2”,”r3”,”r4”)c(“c1”,”c2”,”c3”,”c4”) t(matr)](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-5-2048.jpg)
![How to handle factors in R 6 y=factor(c(“first”,”second”,”first”,”first”,”third”)) 3level z-=y[1:4] Y[6]=“fourth” levels(y)=c(level(y),”fourth”) levels(y)](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-6-2048.jpg)



This document discusses how to handle different data types in R, including lists, matrices, and factors. It provides examples of creating lists and accessing elements within lists. It also demonstrates how to create matrices, add and remove rows/columns, and transpose matrices. Finally, it shows how to create factor variables, subset factors, and add/modify factor levels.



![How to handle list in R 4 a=c(2,3,4) output : 2 3 4 b=(“ab”,”bc”,”ef”) d=c(True,False) list(a,b,d) lst_1=list(abd) lst_1[[1]] lst_1[[1]] [1] Lst_1[[2]][3]=“xy” “ab” ”bc” ”xy”](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-4-2048.jpg)
![How to handle matrices in R 5 matr=matrix(c(1,2,3,4,5,6),nrow=3,ncol=2,byrow=F) 1 4 matr 2 5 3 6 matr[,1] matr[1,] matr[1,1] matr=cbind(matr,c(3,5,7)) ?cbind matr=rbind(matr,c(3,5,7)) dimnames(matr)=list(c(”r1”,”r2”,”r3”,”r4”)c(“c1”,”c2”,”c3”,”c4”) t(matr)](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-5-2048.jpg)
![How to handle factors in R 6 y=factor(c(“first”,”second”,”first”,”first”,”third”)) 3level z-=y[1:4] Y[6]=“fourth” levels(y)=c(level(y),”fourth”) levels(y)](https://image.slidesharecdn.com/handlelistinr-200415060838/75/Handle-list-in-r-6-2048.jpg)


