Hello list, is there any R function for generating spline for implicit
functions, for example a spline for an two-column data frame where for
one value for one variable there maybe several correspondent values for
another? Many thanks.

Currently I'm using this home-made one:
> spline2d <- function(df, ...)
> {
>     xname <- colnames(df)[1]
>     yname <- colnames(df)[2]
>
>     df <- data.frame(c(1 : nrow(df)), df[1], df[2])
>     colnames(df) <- c("index", xname, yname)
>
>     df <- data.frame(
>         spline(df[c("index", xname)], ...)$y,
>         spline(df[c("index", yname)], ...)$y
>     )
>     colnames(df) <- c(xname, yname)
>     return(df)
> }

-- 
    Using GPG/PGP? Please get my current public key (ID: 0xAEF6A134,
valid from 2010 to 2013) from a key server.

Attachment: signature.asc
Description: Digital signature

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to