Skip to content

Instantly share code, notes, and snippets.

@robertzk
Created December 6, 2013 00:01
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 robertzk/7816384 to your computer and use it in GitHub Desktop.
Save robertzk/7816384 to your computer and use it in GitHub Desktop.
R exercise: http://adv-r.had.co.nz/Functions.html Create a list of all the replacement functions found in the base package. Which ones are primitive functions?
x <- ls("package:base")
x[substring(x, nchar(x)-1, nchar(x)) == '<-']
# "[[<-" "[<-" "@<-" "<-" "<<-" "$<-" "attr<-" "attributes<-" "body<-" "class<-" "colnames<-" "comment<-" "diag<-" "dim<-"
# "dimnames<-" "Encoding<-" "environment<-" "formals<-" "is.na<-" "length<-" "levels<-" "mode<-" "mostattributes<-" "names<-" "oldClass<-" "parent.env<-" "regmatches<-" "row.names<-"
# "rownames<-" "split<-" "storage.mode<-" "substr<-" "substring<-" "units<-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment