R Scatterplot

Using plot() function we can create a scatterplot.
We need two points or data vectors it will generate a scatter plot.

Example

# Create sample data
x <- 1:10
y <- 2 * x + 3 + rnorm(10)

# Create a scatter plot
plot(x, y, main = "Scatter Plot", xlab = "X-axis", ylab = "Y-axis", pch = 16, col = "blue")

Using abline()

Using abline() function we can create a common line for tht scatter plot.

Example

# Create sample data
x <- 1:10
y <- 2 * x + 3 + rnorm(10)

# Create a scatter plot
plot(x, y, main = "Scatter Plot with Line", xlab = "X-axis", ylab = "Y-axis", pch = 16, col = "blue")

# Add a line to the plot using abline()
abline(a = 3, b = 2, col = "red", lty = 2)

Quick Recap - Topics Covered

R Scatterplot
Using albine() function

Practice With Examples in Compilers

The Concepts and codes you leart practice in Compilers till you are confident of doing on your own. A Various methods of examples, concepts, codes availble in our websites. Don't know where to start Down some code examples are given for this page topic use the code and compiler.


Example js

Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK