R BASICS
R basic tutorials serve as introductory guides providing fundamental knowledge and practical insights into using the R programming language
INSTALLATION AND FIRST STEPS
R installation is done by downloading and installing the program from the official website. The first steps include getting familiar with the RStudio or R GUI interface and learning the basic syntax
![Learn how to install R and RStudio in Windows and MacOS](/images/featured/installing-r.png)
How to install R and RStudio?
R GUI R STUDIO
![Check which R version is running](/images/featured/r-version.png)
Check which R version is running
R.version R.version.string getRversion()
![Learn how to update R and RStudio](/images/featured/update-r.png)
How to update R and RStudio?
R GUI RStudio
![Change and add themes to customize RStudio](/images/featured/rstudio-themes.png)
RStudio themes
![Learn all about the R programming language operators](/images/featured/operators-r.png)
Operators
<- + - * / > < & |
DATA TYPES
In R, data types include numeric (integer, decimal), character (text), logical (true/false), complex and raw. Each type has specific characteristics and operations that allow you to manipulate and analyze data in a variety of ways in R
![Know the data types in R programming language](/images/featured/data-types-r.png)
Data types
Numeric Character Logic Complex Raw
![The as.numeric function to convert objects to numeric](/images/featured/as-numeric-r.png)
Convert objects to numeric with as.numeric()
as.numeric()
![The as.character() function in R](/images/featured/as-character-r.png)
Convert objects to character with as.character()
as.character()
WORKING DIRECTORY AND WORKSPACE
In R, the working directory refers to the location in the file system where R looks for and stores files by default while the workspace stores variables and objects to maintain continuity of work between sessions
![Learn how to list objects, clear and save the workspace in R](/images/featured/workspace-r.png)
Workspace
rm() ls() save.image() save() saveRDS() load() readRDS() history()
![Learn how to get and set the working directory in R with the setwd and getwd functions](/images/featured/working-directory-r.png)
Working directory
getwd() setwd() dir() list.files() file.create() file.remove() file.copy() file.path() file.info()
FUNCTIONS AND PACKAGES
Functions are reusable blocks of code that perform specific tasks. Packages are sets of functions, data and documentation that extend the functionality of R
![Get help in R with the help functions](/images/featured/help-r.png)
Help
? help() help.start() help.search() apropos() RSiteSearch() vignette()
![Install R package from the available sources (CRAN, Bioconductor, GitHub and R-Forge)](/images/featured/install_r_packages.png)
How to install packages ?
install.packages() library()
![Create your own R functions](/images/featured/functions-r.png)
Create functions
R basics
![Diagnostic messages in R](/images/featured/warning-error-r.png)
Warning and error messages
message() warning() stop()
PRINTING VALUES
These functions are used to display results in the console. They help in the visualization and understanding of the generated information, being useful for inspecting data, displaying calculation results or facilitating the communication of results
![Print values in R with the print(), sprintf(), cat() and noquote() functions](/images/featured/print-r.png)
The print() function
print()
![Print values in R with the print(), sprintf(), cat() and noquote() functions](/images/featured/print-r.png)
Print and concatenate with cat()
cat()
![Print values in R with the print(), sprintf(), cat() and noquote() functions](/images/featured/print-r.png)
Print formatted values
sprintf()
FUNCTIONS RELATED WITH TIME
R provides a number of functions to obtain the system date and time, which can be useful in various situations to manage runtimes and other processes