How to select multiple DataFrame columns by name in R ? Last Updated : 28 Apr, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will discuss how to select multiple columns from a DataFrame by name in R Programming Language. To get multiple columns we will use the list data structure. By using a list we can pass the dataframe columns separated with a comma. Then, we can get list by using list() function Syntax: list(dataframe_name$column1,dataframe_name$column2,.,dataframe_name$column n) Example1: R # create a vector with student id vector1=c(7058,7059,7075,7076) # create a vector with student name vector2=c("Sravan kumar","Jyothika", "Deepika","Kyathi") # create a vector with student address vector3=c("ponnur","tenali","repalle", "ponnur") # pass these vectors to the dataframe dataframe1=data.frame(id=vector1,names=vector2, address=vector3) print(dataframe1) # select multiple columns from the # dataframe1 using list datastructure a=list(dataframe1$id,dataframe1$names,dataframe1$address) print(a) Output: Example 2: R # create a vector with student id vector1=c(7058,7059,7075,7076) # create a vector with student name vector2=c("Sravan kumar","Jyothika", "Deepika","Kyathi") # create a vector with student address vector3=c("ponnur","tenali","repalle","ponnur") # pass these vectors to the dataframe dataframe1=data.frame(id=vector1,names=vector2, address=vector3) print(dataframe1) # select multiple columns from the # dataframe1 using list datastructure a=list(dataframe1$id,dataframe1$names) print(a) Output: Comment More infoAdvertise with us Next Article How to select multiple DataFrame columns by name in R ? S sravankumar_171fa07058 Follow Improve Article Tags : R Language R Programs R-DataFrame R DataFrame-Programs Similar Reads How to Select DataFrame Columns by Index in R? In this article, we will discuss how to select columns by index from a dataframe in R programming language. Note: The indexing of the columns in the R programming language always starts from 1. Method 1: Select Specific Columns By Index with Base R Here, we are going to select columns by using index 2 min read How to Delete Multiple Columns in R DataFrame? In this article, we will discuss how to delete multiple columns in R Programming Language. We can delete multiple columns in the R dataframe by assigning null values through the list() function. Syntax: data[ , c('column_name1', 'column_name2',...........,'column_nam en)] <- list(NULL) where, dat 1 min read Sort a given DataFrame by multiple column(s) in R Sorting of data may be useful when working on a large data and data is un-arranged, so it is very helpful to sort data first before applying operations. In this article, we will learn how to sort given dataframes by multiple columns in R. Approach:Create data frameChoose any more number of columns m 2 min read How to Select Specific Columns in R dataframe? In this article, we will discuss how to select specific columns from a data frame in the R Programming Language. Selecting specific Columns Using Base R by column nameIn this approach to select a specific column, the user needs to write the name of the column name in the square bracket with the name 7 min read How to add suffix to column names in R DataFrame ? Each of the columns in a data frame is defined by a name, known as the column name. It may be of the type of numerical or string value. In this article, we will discuss how to add a suffix to column names in DataFrame in R Programming Language. Method 1 : Using paste() method In order to modify the 4 min read Like