[R] Export R outputs to SAS dataset
Daniel Nordlund
djnord|und @end|ng |rom gm@||@com
Sat Aug 22 23:14:26 CEST 2020
On 8/22/2020 9:05 AM, Rasmus Liland wrote:
> On 2020-08-22 08:17 +0530, Jomy Jose wrote:
> | Hi
> | I was able to run R code via PROC IML
> | in SAS,so is there any way to export
> | the generated outputs to SAS datasets
> | since the R outputs don't follow data
> | frame structure.
>
> Dear Jomy,
>
> But perhaps you can take the outputs in
> SAS and work on them inside from there?
>
> To export a data frame from R to SAS via
> a file[1], you can use
>
> foreign::write.foreign(..., package="SAS")
>
> But I have not tried it.
>
> I have used foreign::read.spss before,
> hehe :-)
>
> I know R is also possible to call from
> Julia, and the df appearing in Julia,
> this sounds like it should be possible
> SAS too[2], yes?
>
> Best,
> Rasmus
>
> [1] https://www.statmethods.net/input/exportingdata.html
> [2] https://documentation.sas.com/?docsetId=imlug&docsetTarget=imlug_r_sect012.htm&docsetVersion=15.1&locale=en
>
> ______________________________________________
> R-help using 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.
Can you give a reproducible example of the R-code you are running and
the R "output" you want to get back in SAS? It is difficult from way
over here to know if you are wanting numerical results like means or
regression coefficients ... or if you just want printed output in your
SAS log or listing.
Dan
--
Daniel Nordlund
Port Townsend, WA USA
More information about the R-help
mailing list