'LazyData' is specified without a 'data' directory error when submitting R package to CRAN
Asked Answered
P

3

21

When I run devtools::check on my package locally, I don't get this error, but when I submit my package to CRAN, or when I run devtools::check_win_devel, I get this error:

'LazyData' is specified without a 'data' directory

I successfully submitted my package to CRAN a week or so ago and didn't get this error, all I changed was the DESCRIPTION file.

Pamphylia answered 29/3, 2021 at 19:45 Comment(0)
P
27

I removed the line

LazyData: True

From my DESCRIPTION file

Pamphylia answered 31/3, 2021 at 14:58 Comment(0)
J
22

Over the course of time, policy settings change. Changes are first implemented in r-devel which is why you see this at win_devel.

This particular change ... was added last week. One way to stay abreast of such changes is to follow the auto-generated 'blog' of changes here https://developer.r-project.org/blosxom.cgi/R-devel/NEWS

I actually just helped a friend on this issue this weekend and took this screenshot from the Feedly RSS feed reader I use:

enter image description here

(The underlining is a formatting artyfact we can ignore).

But in short, you need to check against r-devel, and you actually promise to CRAN each time you upload that you did :)

Jaimiejain answered 29/3, 2021 at 19:51 Comment(4)
Okay, thank you - it seems like I have to specify a 'data' directory? I'm not really clear on how to do that.Pamphylia
There is quite a bit of documentation on this but in short if you package has no data accessed via the data() command then you also have no data/ directory, and hence need to LazyData:... entry. Maybe I am overlooking something here but I think you really should just delete the one offending line from DESCRIPTION.Jaimiejain
Thanks again for your help. I'm sorry, but I don't understand what you mean "hence need to LazyData:... entry." I don't have a data/ directory because I don't have any specific data that the package uses. Should I just create one so that I can get rid of this error? I don't think the line in the DESCRIPTION file is causing the error, all I did was add a reference to a paper.Pamphylia
I missed a word or two there: "hence NO need to [have a] LazyData: entry". But why don't you just remove the line as suggested (just as a test), and see how that package fares at win-builder?Jaimiejain
K
0

Just add the line

LazyDataCompression:xz

to your description file. It worked for me, without deleting LazyData: True, which might be needed to automatically load the data when the package is installed.

Kinesthesia answered 28/12, 2021 at 6:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.