Installed R, then R Studio. https://posit.co/download/rstudio-desktop/
Reading up on the help files from official R website
the R manuals https://cran.r-project.org/doc/manuals/r-release/R-intro.html
there are many other websites that might be easier to read
The help() function and ? help operator
in R provide access to the documentation pages for R functions, data
sets, and other objects, both for packages in the standard R
distribution and for contributed packages. To access documentation for
the standard lm (linear model) function, for example, enter
the command help(lm) or help("lm"),
or ?lm or ?"lm" (i.e., the quotes are
optional). ’summary(mtcars).
http://adv-r.had.co.nz/Style.html
file names should me meaningful + informative
variable and function names should be lowercase. Use underscore (‘_’) to separate words
=, +, -, <-,
etc.).#. Comments should
explain the why, not the what.R Data types are used to specify the kind of data that can be stored in a variable.
For effective memory consumption and precise computation, the right data type must be selected.
Each R data type has its own set of regulations and restrictions.
basic data types in R can be divided into the following types:
numeric - (10.5, 55, 778)
integer - (1L, 55L, 100L, where the letter “L declares this as an integer)
character - (a.k.a. string) - (“k”, “R is exciting”, FALSE”, “11.5”)
logical - (aka boo ean) - (TRUE or FALSE)
complex - (9+3i, where i is the imaginary part)
?datasets()
df <- mtcars
df$mpg2 <- as.integer(df$mpg)
df$mpg3 <- as.numeric(df$mpg2)
df <- as.data.frame(Titanic)
2 > 3
## [1] FALSE
Let me begin by introducing basic math operations
2+2
## [1] 4
5 - 4
## [1] 1
5 * 5
## [1] 25
10 / 2
## [1] 5
{knitr::opts_chunk$set(echo = TRUE)}