20

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.

s460
  • 467
  • 2
  • 9

3 Answers3

24

I removed the line

LazyData: True

From my DESCRIPTION file

s460
  • 467
  • 2
  • 9
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 :)

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Okay, thank you - it seems like I have to specify a 'data' directory? I'm not really clear on how to do that. – s460 Mar 29 '21 at 20:20
  • 5
    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`. – Dirk Eddelbuettel Mar 29 '21 at 20:27
  • 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. – s460 Mar 29 '21 at 22:02
  • 5
    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? – Dirk Eddelbuettel Mar 29 '21 at 22:59
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.