[R] What's the corresponding function in R for lo() function in S-PLUS?

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Sep 17 20:43:00 CEST 2007


On Tue, 2007-09-18 at 01:19 +0800, zhijie zhang wrote:
> Dear friends,
>   In S-PLUS, we can use the following argument, but not in R.
> mode12 <- gam(score1 ~ lo(latitude) + lo(longitude))
>  I searched the help in S-PLUS, it says lo() Allows the user to specify a
> Loess fit in a GAM formula, but i didn't find the correponding function in
> R.
>  Anybody knows how to do the similar task in R?

See function gam() in package gam, available from CRAN, which makes us
of lo() (also available in the gam package). This closely follows the
implementation in S-PLUS.

Note that gam() in recommended package mgcv (distributed with R)
provides an alternative approach to GAM modelling, which you might wish
to take a look at as well.

By the way, you could have solved this yourself in a matter of seconds
if you'd used the R search tools. The following

RSiteSearch("lo", restrict = "functions")

returns the correct answer as the first hit.

HTH

G

>  Thanks very much.
> 
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list