VOOZH about

URL: https://www.geeksforgeeks.org/r-language/choose-specific-columns-of-a-data-frame-in-r-programming-select-function/

⇱ Choose Specific Columns of a Data Frame in R Programming - select() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Choose Specific Columns of a Data Frame in R Programming - select() Function

Last Updated : 15 Jul, 2025
select() function in R Language is used to choose whether a column of the data frame is selected or not.
Syntax: select(x, expr) Parameters: x: Data frame expr: condition for selection
Example 1: Output:
 ht
1 46
2 NA
3 NA
4 69
 name age school
1 Abhi 7 yes
2 Bhavesh 5 yes
3 Chaman 9 no
4 Dimri 16 no
Example 2: Output:
 name age
1 Abhi 7
2 Bhavesh 5
3 Chaman 9
4 Dimri 16
 name age
1 Abhi 7
2 Bhavesh 5
3 Chaman 9
4 Dimri 16
 name
1 Abhi
2 Bhavesh
3 Chaman
4 Dimri
Comment
Article Tags:

Explore