I run analyses in one directory and keep images and textual output in other directories. My test involving a pdf output specifying an output directory relative to the cwd produced a blank image. The command was like this: pdf('../images/filename.pdf') Will R accept an absolute path to an output directory or none at all? TIA, Rich
Don't post. Try it and see. -- Bert On Wed, Sep 12, 2018 at 9:21 AM Rich Shepard <rshepard at appl-ecosys.com> wrote:> > I run analyses in one directory and keep images and textual output in > other directories. My test involving a pdf output specifying an output > directory relative to the cwd produced a blank image. The command was like > this: > pdf('../images/filename.pdf') > > Will R accept an absolute path to an output directory or none at all? > > TIA, > > Rich > > ______________________________________________ > R-help at 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.
On Wed, 12 Sep 2018, Bert Gunter wrote:> Don't post. Try it and see.Bert, Tried using both $HOME and the full path without success and wondered if there was a way to direct output to a different directory that hadn't occurred to me. Rich
Jeff Newmiller
2018-Sep-12 19:43 UTC
[R] Save printed/plotted output to different directory
Yes. I do it all the time. On September 12, 2018 9:26:41 AM PDT, Bert Gunter <bgunter.4567 at gmail.com> wrote:>Don't post. Try it and see. > >-- Bert > > >On Wed, Sep 12, 2018 at 9:21 AM Rich Shepard <rshepard at appl-ecosys.com> >wrote: >> >> I run analyses in one directory and keep images and textual output >in >> other directories. My test involving a pdf output specifying an >output >> directory relative to the cwd produced a blank image. The command was >like >> this: >> pdf('../images/filename.pdf') >> >> Will R accept an absolute path to an output directory or none at >all? >> >> TIA, >> >> Rich >> >> ______________________________________________ >> R-help at 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. > >______________________________________________ >R-help at 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.-- Sent from my phone. Please excuse my brevity.
Hi Rich, Sometimes an empty image is due to not closing the image file. If you forgot to put: dev.off() after the plotting commands, or there was an error in the plotting commands, the file may be left open. Try manually entering "dev.off()" after you have run the code. If you don't get an error: Error in dev.off() : cannot shut down device 1 (the null device) it means that you had an open device. Jim On Thu, Sep 13, 2018 at 2:21 AM Rich Shepard <rshepard at appl-ecosys.com> wrote:> > I run analyses in one directory and keep images and textual output in > other directories. My test involving a pdf output specifying an output > directory relative to the cwd produced a blank image. The command was like > this: > pdf('../images/filename.pdf') > > Will R accept an absolute path to an output directory or none at all? > > TIA, > > Rich > > ______________________________________________ > R-help at 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.
On Thu, 13 Sep 2018, Jim Lemon wrote:> Sometimes an empty image is due to not closing the image file. If you > forgot to put: > > dev.off() > > after the plotting commands, or there was an error in the plotting > commands, the file may be left open. Try manually entering "dev.off()" > after you have run the code. If you don't get an error:Jim, I thought of this and entered dev.off() a couple of times, to no avail. Then I quit R and restarted it. That cleared the problem. A typo slipped in the script elsewhere when I modified the path for the output PDF file. That probably jammed the device. Fixing the typo did not address the constipation it caused, but killing the process and starting it again did the job. Thanks for the information! Best regards, Rich