Skip to content

Instantly share code, notes, and snippets.

@akshat3096
Created May 14, 2019 10:58
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/bad0216a3cc10bd5496a9099658f1fd9 to your computer and use it in GitHub Desktop.
Save akshat3096/bad0216a3cc10bd5496a9099658f1fd9 to your computer and use it in GitHub Desktop.
x <- matrix(1:6,nrow=2,ncol=3)
x
#selecting an element
x[1,1]
#selecting just one row
x[2,]
# selecting one or more columns
x[,c(1,2)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment