### ----------------------------------------------------------------------- ### Autor: Paul Fink, et. al. (Stand: SoSe 2017) ### ----------------------------------------------------------------------- ## ----prevobejcts--------------------------------------------------------- numvec <- c(2.54, 4.22, 2.99, 3.14, 3.44) charvec <- c("Statistische", "Software") logicvec <- c(TRUE, FALSE, FALSE, TRUE) ## ----list1--------------------------------------------------------------- mat <- matrix(seq(from = 2, by = 3, length = 12), nrow = 3) list1 <- list(numeric = numvec, character = charvec, matrix = mat) list1 ## ----list2--------------------------------------------------------------- list2 <- list(logicvec, list = list1) list2 ## ----listzugriff1-------------------------------------------------------- list1[[1]][2] ## ----listzugriff2-------------------------------------------------------- list2$list$numeric[2] ## ----namenabfragen------------------------------------------------------- names(list1) names(list2) names(1:8) ## ----headmtcars---------------------------------------------------------- head(mtcars) ## ----namesdataframe------------------------------------------------------ rownames(mtcars) colnames(mtcars) # oder 'names(mtcars)' ## ----zugriffdataframeindex----------------------------------------------- mtcars[1:4,] ## ----zugriffdataframename------------------------------------------------ mtcars$cyl