Cannot generate scatterplot in R. Printing plot returns NULL -


unable generate scatterplot, code:

png(file = "monthvsuniquecode.png")  p1<-plot(x = month_uc$new.col,y = month_uc$uniquecode,       xlab = "month",      ylab = "uniquecode",      main = "month vs uniquecode" ) dev.off()  print(p1) 

printing plot returns null.

print(p1) null


my month_uc dataframe has 56003 rows , 2 columns (uniquecode int, month char)


note: i've learnt r 4 hours back. doing wrong?

i believe basic plotting functions not allow plots assigned objects. can do:

png(file = "monthvsuniquecode.png") plot(x = month_uc$new.col,      y = month_uc$uniquecode,      xlab = "month",      ylab = "uniquecode",      main = "month vs uniquecode" ) dev.off() 

to save png. or just:

plot(x = month_uc$new.col,      y = month_uc$uniquecode,      xlab = "month",      ylab = "uniquecode",      main = "month vs uniquecode" ) 

to display it.


Comments

Popular posts from this blog

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - SSE Emitter : Manage timeouts and complete() -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -