October 2017
Beginner to intermediate
236 pages
7h 38m
English
The object conversion in R is very intuitive and easy to understand. The name of the function itself tells the story. Let's perform the following steps to convert a matrix to a data frame and a data frame to a matrix:
M1ToData <- as.data.frame(M1)
> str(M1ToData) 'data.frame': 3 obs. of 3 variables: $ V1: int 1 4 7 $ V2: int 2 5 8 $ V3: int 3 6 9