I'm new to R
, and have imported my dataset as follows (dots mean that there is remaining data):
> num.csv <- read.csv("c:/num.csv", header=T)
> print(num.csv)
X.Y
1 22500;482
2 25842;1
3 27221;1
4 32757;1
5 40152;1
. .
. .
. .
How can I make a scatter plot for this data?
Thanks.
First, the data needs to be in separate columns. While the file is labeled "csv", you appear to be using semicolons to separate instead of commas. Either reformat the file or try:
num.csv <- read.csv("c:/num.csv", header=T, sep=";")
Then you can use one of the various plotting packages with R to make a plot. For example:
install.packages("ggplot2"); #ggplot2 is not part of the standard install...
library(ggplot2);
qplot(X, Y, data=num.csv);
I have not tested the above, it depends on how your data frame comes out of read.csv.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With