My Coding >
Software >
R >
R data.frame
R data.frameData.frame in R is one of the data types in R. This is most common data type in R and it is very important to know how to use it. From one hand it is matrix of different type of objects, but from other side is a structure with rows and columns. Data.frame creation in RThe simplest way to create data.frame is to join few vectors together
Extracting data from the data.frameIt is possible to extract rows and columns for data.frame Extracting columns from the data.frameSlice will extract column as a vector. It is possible to call it by using it's name with $ sign
Extracting column as a listUsing name of the column will produce list with it’s content
Extracting rows from the data.frameBy calling slice from the data.frame it is possible to have named list
To extract an individual value you can use standard list use for the row. Also you can specify the exact number of column
By slicing, it is possible to have a subset from the data.frame
Structure of data.frameTo investigate the structure of the data.frame it is possible to use two standard functions:
|
Last 10 artitles
9 popular artitles
|
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |