R DataFrame
An R DataFrame is kind of a tabular data. It contains a list of columns where each column has same number of rows.
In this tutorial, we will see a basic example of an R DataFrame, and the list of tutorials covering different scenarios of Data Frame.
Example for R DataFrame
The following is an example for R Data Frame with three columns and four rows.
c1, c2, c3 are the columns. 1, 2, 3 and 4 are the rows.
And we have used following R script to generate the above Data Frame.
df <- data.frame("c1" = c(41, 42, 43, 44),
"c2" = c(45, 46, 47, 48),
"c3" = c(49, 50, 51, 52))
data.frame() function creates a new DataFrame.
R DataFrame Tutorials
These tutorials cover all the topics related to an R DataFrame.
DataFrame Basic Tutorials
In the following tutorials, we will learn how to create a DataFrame in different ways, and how to access the elements of a DataFrame.
- R – Create empty DataFrame
- R – Create DataFrame
- R – Create DataFrame with column names
- R – Create DataFrame with column names from another DataFrame
- R – Create DataFrame with row names
- R – Create DataFrame with one column
- R – Create DataFrame with empty columns
- R – Create DataFrame from matrix
- R – Create DataFrame from CSV
- R – Create DataFrame from vectors
- R – Create DataFrame from column of another DataFrame
- R DataFrame – Access element at position i, j
DataFrame Row Tutorials
In the following tutorials, we cover different operations that we can do on DataFrame rows.
- R DataFrame – Get number of rows
- R DataFrame – Select row by index
- R DataFrame – Add row
- R DataFrame – Remove row(s)
- R DataFrame – Delete duplicate rows
- R DataFrame – Remove NA rows
- R DataFrame – Reset row numbers
DataFrame Column Tutorials
In the following tutorials, we cover different operations that we can do on DataFrame columns.
- R DataFrame – Get number of columns
- R DataFrame – Add column
- R DataFrame – Delete columns
- R DataFrame – Rename column(s)
- R DataFrame – Select column by index
- R DataFrame – Select column by name
- R DataFrame – Select first column
- R DataFrame – Select last column
- R DataFrame – Select multiple columns by index
- R DataFrame – Select multiple columns by name
DataFrame Sorting
In the following tutorials, we will learn how to sort a DataFrame based on a column, or multiple columns, etc.
DataFrame Filtering
In the following tutorials, we will learn how to filter a DataFrame based on a given condition.
DataFrame Conversions
In the following tutorials, we will learn how to convert a DataFrame to other data types, or from other data types to DataFrame.
DataFrame Transformations
In the following tutorials, we will learn how to transform a DataFrame based on the given requirement.
Operations with two or more DataFrames
In the following tutorials, we will learn how to combine two DataFrames, compare DataFrames, or any such operations that include two or more DataFrames.
DataFrame Import / Export
In the following tutorials, we will learn how to import a DataFrame from a data source.
DataFrame – Other Tutorials
These tutorials cover topics that are not covered in the above sections.
Conclusion
In this R Tutorial, we learned what a Data Frame is, in R language, and listed out different tutorials on R Data Frames.