- How to create a basic scatter plot in R? More
data(mtcars)
plot(mtcars$wt, mtcars$mpg, xlab = "Weight", ylab = "Miles per Gallon", main = "Scatter Plot of Weight vs Miles per Gallon")
- How to create a basic bar chart in R? More
# Import data
data(mtcars)
# Create bar chart
barplot(table(mtcars$gear), xlab = "Number of Gears", ylab = "Frequency", main = "Bar Chart of Gear Frequencies")
- How to create a basic line chart in R? More
# Import data
data(AirPassengers)
# Create line chart
plot(AirPassengers, xlab = "Year", ylab = "Number of Passengers", main = "Line Chart of Air Passenger Numbers")
- How to create a basic pie chart in R? More
# Import data
data(mtcars)
# Create pie chart
pie(table(mtcars$gear), main = "Pie Chart of Gear Frequencies")
- How to create a histogram in R? More
data(mtcars)
hist(mtcars$mpg, xlab = "Miles per Gallon", main = "Histogram of Miles per Gallon")
댓글 없음:
댓글 쓰기