Please enable JavaScript.
Coggle requires JavaScript to display documents.
R Software 2 (Exploring Data (head() (default shows first 6 rows, but can…
R Software 2
Exploring Data
-
head()
default shows first 6 rows, but can specify any number as an argument to see however little much of the data set you want
-
-
-
-
-
-
-
Debugging Functions
-
debug()
it's input is your function. it flags my function for debug mode and suspends execution at the first line so you can step through the function line by line to find a problem . it's the debugging at the top of my function
browser()
allows me to step through line by line like debug but you can insert it anywhere in my function so I don't to start from the beginning
-
-
Loop Functions
lapply
-
sapply
a variant of "lapply", it tries to simply the result that would come out of lapply
-
-
tapply
short for table apply, it applies a function over a subset of a vector
-
Coding Standards
-
2) indent the code
To change this in R:
1) click Rstudio in upper tool bar 2) click preferences 3)code editing 4) enter # for tab width. min 4, 8 ideal 5) can also set max number of columns for width
-
-
str()
means structure, allows me to compactly display lists. gives roughy 1 line of output per basic object. allows me to see easily what's IN an object
-