[R] source() or OS X Lion?

Duncan Murdoch murdoch.duncan at gmail.com
Fri Aug 5 03:22:06 CEST 2011


On 11-08-04 5:24 PM, Mark Ebbert wrote:
> Dear R Gurus,
>
> I'm seeing some strange behavior that I can't explain. I'm generating a figure for a paper and I like to save the script (no matter how simple) for future reference. My practice is to write the script and run it using the 'source()' function. What's weird is that the resultant figure is not readable by OS X 10.7.0 (Lion). While trying to figure out what I did wrong, I discovered that typing the exact same code into the R prompt (running in Terminal) will produce the figure as I would expect it. The only idea I have is that something has changed in Lion that doesn't allow 'source()' to interpret it properly.
>
> Any ideas? Here is the exact code I'm using:
>    1 x<-read.delim("path/data.txt")
>    2
>    3 pdf("path/PaperFig-hist_of_perc_change-individ_samps-by_subtype.pdf")
>    4 histogram(~Total.Change,data=x,xlab="Percent Change")
>    5 dev.off()
>
> I appreciate any help. I'm especially curious if there's a Lion user who could give this a try.

I don't have Lion, but it would be helpful to know what "not readable" 
means.  If you try to open the file in Preview, what happens?

Duncan Murdoch

>
> OS X 10.7.0 (Lion)
> R version 2.13.0 (2011-04-13)
> Copyright (C) 2011 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> ______________________________________________
> 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