[R] loess plotting problem

Anupam Tyagi @nupty@g| @end|ng |rom gm@||@com
Thu Mar 23 15:18:40 CET 2023


For some reason the following code is not plotting as I want it to. I want
to plot a "loess" line plotted over a scatter plot. I get a jumble, with
lines connecting all the points. I had a similar problem with "lowess". I
solved that by dropping "NA" rows from the data columns. Please help.

library(stats)
attach(gini_pci_wdi_narm)
plot(ny_gnp_pcap_pp_kd, si_pov_gini)
lines(loess(si_pov_gini ~ ny_gnp_pcap_pp_kd, gini_pci_wdi_narm))
detach(gini_pci_wdi_narm)

-- 
Anupam.

	[[alternative HTML version deleted]]



More information about the R-help mailing list