[R] write.fortran

baptiste auguie baptiste.auguie at googlemail.com
Wed Mar 10 13:52:04 CET 2010


Thanks, it is indeed a bit cleaner. I was hoping for a more generic
solution but I guess people use cat() and sprintf() in such cases.

Thanks,

baptiste

On 10 March 2010 12:46, Berend Hasselman <bhh at xs4all.nl> wrote:
>
>
>
> baptiste auguie-5 wrote:
>>
>>
>> This is a lot easier
>>
>>  for(k in
>> seq(1,nrow(m))){cat(c(sprintf("%7d",m[k,1]),sprintf("%16.7e",m[k,2:8]),"\n"))
>>
>> Berend
>>
>
> Oops.
> Missing sep="" and closing }.
> The correct line is
>
> for(k in
> seq(1,nrow(m))){cat(c(sprintf("%7d",m[k,1]),sprintf("%16.7e",m[k,2:8]),"\n"),sep="")}
>
> Berend
> --
> View this message in context: http://n4.nabble.com/write-fortran-tp1587119p1587272.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list