This repository contains my files and folders about R programming that I am practicing. I am learning R from various sources, such as books, online courses, and tutorials. I am interested in applying R to different domains, such as finance, health, and social media.
The repository is organized as follows:
course-materials
: This folder contains the materials from the online course [Introduction to R Programming] that I am taking on freecodecamp. The course covers the basics of R programming, data manipulation, data visualization, and statistical analysis.practice-session-1
: This folder contains the files from the first practice session that I did on freecodecamp. The session involved working with the [mtcars] dataset and performing some exploratory data analysis using R.
Installation
To run the scripts and projects in this repository, you will need to install R and some packages. To install a package in R, you can use the install.packages()
function. For example, to install the ggplot2
package for data visualization, you can run the following command in the R console:
install.packages("ggplot2")
Some of the packages that I have used or plan to use in this repository are:
ggplot2
: A package for creating elegant and expressive graphics in R.dplyr
: A package for manipulating and transforming data in R.tidyr
: A package for tidying and reshaping data in R.stringr
: A package for working with strings in R.lubridate
: A package for working with dates and times in R.caret
: A package for training and testing machine learning models in R.
You can also install multiple packages at once by using a vector of package names. For example, to install the packages listed above, you can run the following command in the R console:
install.packages(c("ggplot2", "dplyr", "tidyr", "stringr", "lubridate", "caret"))
To run a script or a project in this repository, you can either open it in an IDE (such as [RStudio]) or run it from the command line. For example, to run the script histogram.R in the folder R-visualization, you can use the following command:
Rscript R-visualization/histogram.R
This will execute the script and produce a histogram of the iris dataset.