Skip to content

Instantly share code, notes, and snippets.

@akshat3096
Created May 14, 2019 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshat3096/1ce63459469a675a4ee38f93d8f32ae8 to your computer and use it in GitHub Desktop.
Save akshat3096/1ce63459469a675a4ee38f93d8f32ae8 to your computer and use it in GitHub Desktop.
x <-c(10,12,23,45,84,25,15,56,09)
#selecting one element
x[1]
#selecting multiple elements
x[c(3,9)]
#dropping certain elements
x[-c(1,2)]
#checking for values gretaer than 20
x[x>20]
#blank brackets, returns the original vector
x[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment