On 23/03/2016 5:36 AM, catalin roibu wrote:
Dear R users,
I have a dataframe with 6 columns and I want to create a plot (with for
loop). My question is how to add points in the for loop? I tried this code,
but without success.
vv<-rbind(colnames(ext))
for(i in 1:ncol(vv)){
with(ext, plot(rownames(ext), ext[,i], type="p",las=1,
bty="n",cex.main=2, cex.axis=1.5))
}
Please help me to solve that!
You can call the points() function to add points to an existing plot.
The main difficulty is that the initial call to plot() establishes the
axes and coordinate system; if later points fall outside the plot area,
they won't be shown. So you may need to work out xlim and ylim in advance.
Duncan Murdoch
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.