This example uses the dataset "Pima.tr" found in the R package "MASS".
-
Convert the dataset to an Aster virtual data frame "tadf_Pima_tr", and list the first six rows of the data frame.
tadf_Pima_tr<-as.ta.data.frame(Pima.tr) ta.head(tadf_Pima_tr) npreg glu bp skin bmi ped age type 1 5 86 68 28 30.2 0.364 24 No 2 7 195 70 33 25.1 0.163 55 Yes 3 5 77 82 41 35.8 0.156 35 No 4 0 165 76 43 47.9 0.259 26 No 5 0 107 60 25 26.4 0.133 23 No 6 5 97 76 27 35.6 0.378 52 Yes
-
Use the Aster R runner function ta.colApply() to calculate the mean of each numeric column in the dataset.
ta.colApply(tadf_Pima_tr[1:7], mean) npreg glu bp skin bmi ped age 3.570000 123.970000 71.260000 29.215000 32.310000 0.460765 32.110000