# Creating sample data
set.seed(123)
x <- rnorm(100)
y <- rnorm(100)
# Creating a scatter plot
plot(x, y, main = "Scatter Plot", xlab = "X Axis", ylab = "Y Axis", pch = 19, col = "blue")
TERE
June 21, 2024
Data visualization is a crucial aspect of data analysis, allowing us to explore, understand, and communicate insights from data. R offers a rich ecosystem for creating graphics, with powerful tools and packages that enable the creation of a wide variety of plots. In this lecture, we will introduce the basics of R graphics, focusing on the base R plotting system.
The base R plotting system provides a simple and flexible way to create a wide range of plots. It is built into R and does not require additional packages, making it a great starting point for creating visualizations.
Scatter Plot: Displays the relationship between two numerical variables.
Line Chart: Shows trends over time or ordered categories.
Bar Plot: Represents categorical data with rectangular bars.
Histogram: Visualizes the distribution of a numerical variable.
Box Plot: Summarizes the distribution of a numerical variable using five-number summary.
A scatter plot displays the relationship between two numerical variables.
A line chart shows trends over time or ordered categories.
A bar plot represents categorical data with rectangular bars.
A histogram visualizes the distribution of a numerical variable.
A box plot summarizes the distribution of a numerical variable using the five-number summary.
In this lecture, we introduced the basics of R graphics using the base R plotting system. We covered how to create and customize various types of plots, including scatter plots, line charts, bar plots, histograms, and box plots. These basic techniques form the foundation for more advanced data visualization in R.
For more detailed information, consider exploring the following resources:
If you found this lecture helpful, make sure to check out the other lectures in the R Graphs series. Happy plotting!