Wednesday, 15 April 2015

plot - R help needed with plotting simple graphs -



plot - R help needed with plotting simple graphs -

diamonds <- read.table('test1.csv', head=t) plot(diamonds$carat, diamonds$price, xlab="carat", ylab="price")

data correctly imported. not beingness able create plot in (1) because of:

error in plot.window(...) : need finite 'xlim' values in addition: warning messages: 1: in min(x) : no non-missing arguments min; returning inf 2: in max(x) : no non-missing arguments max; returning -inf 3: in min(x) : no non-missing arguments min; returning inf 4: in max(x) : no non-missing arguments max; returning -inf

some of info is:

id carat colour clarity certification variableprice cost 1 0.3 d vs2 gia 1302 3.114610984 2 0.3 e vs1 gia 1510 3.178976947 3 0.3 g vvs1 gia 1510 3.178976947 4 0.3 g vs1 gia 1260 3.100370545 5 0.31 d vs1 gia 1641 3.215108581 6 0.31 e vs1 gia 1555 3.191730393 7 0.31 f vs1 gia 1427 3.154423973 8 0.31 g vvs2 gia 1427 3.154423973 9 0.31 h vs2 gia 1126 3.051538391

please kindly assist info plotting including necessary r code. thanks

you need check you're calling columns proper names. r case-sensitive; given sample info provided, diamonds$price doesn't work, diamonds$price will. try:

plot(x=diamonds$carat, y=diamonds$price, xlab="carat", ylab="price")

r plot

No comments:

Post a Comment