How do you convert this from S Plus to R - any help appreciated . thanks

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you convert this from S Plus to R - any help appreciated . thanks

Briggs, Meredith M




exportData(MU.Cost,paste("C:/RAUDSL/S",as.character(MU.Cost$Run.Id[1]),"
.",as.character(MU.Cost$MU.Id[1]),".MU.PRICE.OUTPUT.txt",sep=""),append
= FALSE,type="ASCII",quote=FALSE)

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do you convert this from S Plus to R - any help appreciated . thanks

Prof Brian Ripley
There is an `R Data Import/Export' manual to guide you on how to do data
export in R.  Please consult it.

I only know vaguely what format exportData(type="ASCII") uses, and it is
probably easier to work out what you want and tailor write.table() to give
that.  (I am not aware that the fine details of exportData are
documented.)

On Fri, 27 Jan 2006, Briggs, Meredith M wrote:

> exportData(MU.Cost,paste("C:/RAUDSL/S",as.character(MU.Cost$Run.Id[1]),"
> .",as.character(MU.Cost$MU.Id[1]),".MU.PRICE.OUTPUT.txt",sep=""),append
> = FALSE,type="ASCII",quote=FALSE)

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do you convert this from S Plus to R - any help appreciated . thanks

barry rowlingson
In reply to this post by Briggs, Meredith M
Briggs, Meredith M wrote:

> exportData(MU.Cost,paste("C:/RAUDSL/S",as.character(MU.Cost$Run.Id[1]),"
> .",as.character(MU.Cost$MU.Id[1]),".MU.PRICE.OUTPUT.txt",sep=""),append
> = FALSE,type="ASCII",quote=FALSE)

  Looks like perfectly good R to me.

  Except there's no exportData function. I assume this is an Splus
function that R doesn't have, in which case telling us what it does
might help. What does the Splus manual have to say about it?

I'm guessing R's write.table might be of use.

  Assuming its exportData that has you stuck - the other bits should
allwork in R no problem, all it does is construct a path from parts of
the MU.Cost object.

Barry

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do you convert this from S Plus to R - any help appreciated . thanks

Bill.Venables
In reply to this post by Briggs, Meredith M
This particular call to exportData is probably equivalent in effect to
the R call:

write.table(MU.Cost,
        file = paste("C:/RAUDSL/S",
                            as.character(MU.Cost$Run.Id[1]),
                                ".",as.character(MU.Cost$MU.Id[1]),
                                ".MU.PRICE.OUTPUT.txt", sep=""),
        append = FALSE)

as Barry sort of guesses, but in general exportData handles a wide
variety of data export facilities, including writing to odbc connexions,
so other uses of exportData would need the RODBC library in R and
functions like sqlSave or sqlUpdate.

write.table is also an S-PLUS function as well, but exportData is
generally a whole lot faster.

Bill Venables.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Barry Rowlingson
Sent: Friday, 27 January 2006 7:57 PM
To: [hidden email]
Subject: Re: [R] How do you convert this from S Plus to R - any help
appreciated . thanks


Briggs, Meredith M wrote:

>
exportData(MU.Cost,paste("C:/RAUDSL/S",as.character(MU.Cost$Run.Id[1]),"
>
.",as.character(MU.Cost$MU.Id[1]),".MU.PRICE.OUTPUT.txt",sep=""),append
> = FALSE,type="ASCII",quote=FALSE)

  Looks like perfectly good R to me.

  Except there's no exportData function. I assume this is an Splus
function that R doesn't have, in which case telling us what it does
might help. What does the Splus manual have to say about it?

I'm guessing R's write.table might be of use.

  Assuming its exportData that has you stuck - the other bits should
allwork in R no problem, all it does is construct a path from parts of
the MU.Cost object.

Barry

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html