emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error "No :file header argument given"
@ 2015-12-01  9:07 Loris Bennett
  2015-12-01 16:02 ` Loris Bennett
  0 siblings, 1 reply; 6+ messages in thread
From: Loris Bennett @ 2015-12-01  9:07 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

At the beginning of each month I generate a plot via a CALL to a block
of R code:

#+CALL: code;plot_usage_historical_facet(type="users")

The type is used as part of the name of the output file.  Today I got
the error:

user-error: No :file header argument given; cannot create graphical result.

I have certainly updated Org since the last time I tried to create the
plot and am now running version 8.3.2 (8.3.2-39-gd537a3-elpaplus).

Is this (new) behaviour expected?  If, so what do I have to do to
generate a plot file with a name which is dependent on an argument?

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error "No :file header argument given"
  2015-12-01  9:07 Error "No :file header argument given" Loris Bennett
@ 2015-12-01 16:02 ` Loris Bennett
  2015-12-02  7:22   ` Error "No :file header argument given" - minor bug? Loris Bennett
  2015-12-17 17:25   ` Error "No :file header argument given" Grant Rettke
  0 siblings, 2 replies; 6+ messages in thread
From: Loris Bennett @ 2015-12-01 16:02 UTC (permalink / raw)
  To: emacs-orgmode

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> Hi,
>
> At the beginning of each month I generate a plot via a CALL to a block
> of R code:
>
> #+CALL: code;plot_usage_historical_facet(type="users")
>
> The type is used as part of the name of the output file.  Today I got
> the error:
>
> user-error: No :file header argument given; cannot create graphical result.
>
> I have certainly updated Org since the last time I tried to create the
> plot and am now running version 8.3.2 (8.3.2-39-gd537a3-elpaplus).
>
> Is this (new) behaviour expected?  If, so what do I have to do to
> generate a plot file with a name which is dependent on an argument?

Looking at my code again, I think I may have been mistaken and this may
never have worked as I describe above.

Thus the question should be:

Is it possible to have a variable as part of the :file specification?

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error "No :file header argument given" - minor bug?
  2015-12-01 16:02 ` Loris Bennett
@ 2015-12-02  7:22   ` Loris Bennett
  2015-12-03 18:31     ` Aaron Ecay
  2015-12-17 17:25   ` Error "No :file header argument given" Grant Rettke
  1 sibling, 1 reply; 6+ messages in thread
From: Loris Bennett @ 2015-12-02  7:22 UTC (permalink / raw)
  To: emacs-orgmode

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> "Loris Bennett" <loris.bennett@fu-berlin.de> writes:
>
>> Hi,
>>
>> At the beginning of each month I generate a plot via a CALL to a block
>> of R code:
>>
>> #+CALL: code;plot_usage_historical_facet(type="users")
>>
>> The type is used as part of the name of the output file.  Today I got
>> the error:
>>
>> user-error: No :file header argument given; cannot create graphical result.
>>
>> I have certainly updated Org since the last time I tried to create the
>> plot and am now running version 8.3.2 (8.3.2-39-gd537a3-elpaplus).
>>
>> Is this (new) behaviour expected?  If, so what do I have to do to
>> generate a plot file with a name which is dependent on an argument?
>
> Looking at my code again, I think I may have been mistaken and this may
> never have worked as I describe above.
>
> Thus the question should be:
>
> Is it possible to have a variable as part of the :file specification?

To answer my own question:

Probably not, but in my case it isn't necessary.

In my R code I have:

  ggsave(filename=paste0("./usage_",type,"_historical_facet.pdf"),plot=p)

and this produces, as desired, an output file where the file name
depends on the argument passed by CALL, e.g.

  #+CALL: code;plot_usage_historical_facet(type="users")

What threw me was that you still need ':file' header but the name
specified there is irrelevant, e.g.

  #+HEADER: :file tmp.pdf

When the block is evaluated, the file I want with the correct,
argument-dependent name is created.  However I also get 'tmp.pdf', but
this file just seems to be an empty PDF shell without any pages.

So this seems to be a minor bug.  Maybe ':file' should be able to take
a value which indicates that the name of the file will come from within
the block.

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error "No :file header argument given" - minor bug?
  2015-12-02  7:22   ` Error "No :file header argument given" - minor bug? Loris Bennett
@ 2015-12-03 18:31     ` Aaron Ecay
  2015-12-04  8:50       ` Loris Bennett
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ecay @ 2015-12-03 18:31 UTC (permalink / raw)
  To: Loris Bennett, emacs-orgmode

Hi Loris,

It’s difficult to say without more context, but I think you might not
need :results graphics on the code block that you are #+call-ing.
:results graphics is intended for situations where Org should arrange
for the plot to be written, whereas you have undertaken this yourself.

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error "No :file header argument given" - minor bug?
  2015-12-03 18:31     ` Aaron Ecay
@ 2015-12-04  8:50       ` Loris Bennett
  0 siblings, 0 replies; 6+ messages in thread
From: Loris Bennett @ 2015-12-04  8:50 UTC (permalink / raw)
  To: emacs-orgmode

Hi Aaron,

Aaron Ecay <aaronecay@gmail.com> writes:

> Hi Loris,
>
> It’s difficult to say without more context, but I think you might not
> need :results graphics on the code block that you are #+call-ing.
> :results graphics is intended for situations where Org should arrange
> for the plot to be written, whereas you have undertaken this yourself.

You're right.  I don't need ':results graphics'.  After removing it and
the ':file' header, just the file with the desired name is produced.  At
first I got the following error

org-babel-ref-resolve: Wrong type argument: consp, nil

but this was just due to not having updated the headers.

Thanks for the help,

Loris
-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error "No :file header argument given"
  2015-12-01 16:02 ` Loris Bennett
  2015-12-02  7:22   ` Error "No :file header argument given" - minor bug? Loris Bennett
@ 2015-12-17 17:25   ` Grant Rettke
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Rettke @ 2015-12-17 17:25 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode@gnu.org

On Tue, Dec 1, 2015 at 10:02 AM, Loris Bennett
<loris.bennett@fu-berlin.de> wrote:
> Is it possible to have a variable as part of the :file specification?

Not sure how your ECM might look but header arguments can be populated
by Emacs Lisp calls so you use whatever variables you want.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-17 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  9:07 Error "No :file header argument given" Loris Bennett
2015-12-01 16:02 ` Loris Bennett
2015-12-02  7:22   ` Error "No :file header argument given" - minor bug? Loris Bennett
2015-12-03 18:31     ` Aaron Ecay
2015-12-04  8:50       ` Loris Bennett
2015-12-17 17:25   ` Error "No :file header argument given" Grant Rettke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).