Discussion:
[Roxygen-devel] Documenting data in data directory
Rainer M Krug
2015-08-25 09:43:05 UTC
Permalink
Hi

I am trying to document data which is defined in a file named
./data/fileNames.R which looks as follow:

--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---

But I am struggling with documenting it.

It seems that when I put the

I have the following documentation for CACHE in the file ./R/CACHE.R:

--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#' @format Character vector of length one.
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---

But I get the following error when running roxygenise():

,----
| Error: Failure in roxygen block beginning CACHE.R:1
| object 'CACHE' not found
`----

Any suggestions how I can document each data variable?

Thanks,

Rainer
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
Hadley Wickham
2015-08-25 11:58:00 UTC
Permalink
You possibly don't have LazyData: true in your DESCRIPTION.
Hadley
Post by Rainer M Krug
Hi
I am trying to document data which is defined in a file named
--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---
But I am struggling with documenting it.
It seems that when I put the
--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---
,----
| Error: Failure in roxygen block beginning CACHE.R:1
| object 'CACHE' not found
`----
Any suggestions how I can document each data variable?
Thanks,
Rainer
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
_______________________________________________
Roxygen-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
--
http://had.co.nz/
Rainer M Krug
2015-08-25 12:56:21 UTC
Permalink
Post by Hadley Wickham
You possibly don't have LazyData: true in your DESCRIPTION.
Thank - I had

LazyData: yes

and now I have

LazyData: true

but I still get the same error message?

Rainer
Post by Hadley Wickham
Hadley
Post by Rainer M Krug
Hi
I am trying to document data which is defined in a file named
--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---
But I am struggling with documenting it.
It seems that when I put the
--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---
,----
| Error: Failure in roxygen block beginning CACHE.R:1
| object 'CACHE' not found
`----
Any suggestions how I can document each data variable?
Thanks,
Rainer
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
_______________________________________________
Roxygen-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: ***@krugs.de

Skype: RMkrug

PGP: 0x0F52F982
Hadley Wickham
2015-08-25 12:59:02 UTC
Permalink
Oooh, I didn't carefully read your data file - I don't think roxygen2
supports .R files in your data dir. You'll need to do it by "hand",
ie.

#' location of cache
#'
# Cache to be used for the computations
#'
#' @format Character vector of length one.
#' @name CACHE
#' @docType data
NULL

Hadley
Post by Rainer M Krug
Post by Hadley Wickham
You possibly don't have LazyData: true in your DESCRIPTION.
Thank - I had
LazyData: yes
and now I have
LazyData: true
but I still get the same error message?
Rainer
Post by Hadley Wickham
Hadley
Post by Rainer M Krug
Hi
I am trying to document data which is defined in a file named
--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---
But I am struggling with documenting it.
It seems that when I put the
--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---
,----
| Error: Failure in roxygen block beginning CACHE.R:1
| object 'CACHE' not found
`----
Any suggestions how I can document each data variable?
Thanks,
Rainer
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
_______________________________________________
Roxygen-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
Skype: RMkrug
PGP: 0x0F52F982
--
http://had.co.nz/
Rainer M Krug
2015-08-25 13:06:35 UTC
Permalink
Post by Hadley Wickham
Oooh, I didn't carefully read your data file - I don't think roxygen2
supports .R files in your data dir. You'll need to do it by "hand",
ie.
#' location of cache
#'
# Cache to be used for the computations
#'
NULL
OK - I'll do it like that.

Thanks,

Rainer
Post by Hadley Wickham
Hadley
Post by Rainer M Krug
Post by Hadley Wickham
You possibly don't have LazyData: true in your DESCRIPTION.
Thank - I had
LazyData: yes
and now I have
LazyData: true
but I still get the same error message?
Rainer
Post by Hadley Wickham
Hadley
Post by Rainer M Krug
Hi
I am trying to document data which is defined in a file named
--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---
But I am struggling with documenting it.
It seems that when I put the
--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---
,----
| Error: Failure in roxygen block beginning CACHE.R:1
| object 'CACHE' not found
`----
Any suggestions how I can document each data variable?
Thanks,
Rainer
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
_______________________________________________
Roxygen-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
Skype: RMkrug
PGP: 0x0F52F982
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: ***@krugs.de

Skype: RMkrug

PGP: 0x0F52F982
meik michalke
2015-08-25 13:08:18 UTC
Permalink
hi,
Post by Rainer M Krug
Hi
I am trying to document data which is defined in a file named
--8<---------------cut here---------------start------------->8---
CACHE <- file.path( getwd(), "cache")
SQLITEDB <- file.path(CACHE, "energyBalance.sqlite")
--8<---------------cut here---------------end--------------->8---
But I am struggling with documenting it.
It seems that when I put the
--8<---------------cut here---------------start------------->8---
#' location of cache
#'
# Cache to be used for the computations
#'
#'
"CACHE"
--8<---------------cut here---------------end--------------->8---
first guess -- perhaps try:

CACHE <- ""

instead.

second guess, if you would like to use the CACHE object defined in
fileNames.R, try adding

#' @include ../data/fileNames.R

to CACHE.R


viele grüße :: m.eik
--
dipl. psych. meik michalke
institut f"ur experimentelle psychologie
abt. f"ur diagnostik und differentielle psychologie
heinrich-heine-universit"at d-40204 d"usseldorf
Loading...