3

I installed asreml.d on R 2.14.0 using Install packages from local zip files from the Packages menu. When I try to load the package with library(asreml.d), I get the following error

Error in library(asreml.d) : 
  package ‘asreml.d’ does not have a NAMESPACE and should be re-installed

Error occur even after re-installation. Any comment, idea and solution to fix this problem will be highly appreciated. Thanks in advance for your time and help.

MYaseen208
  • 22,666
  • 37
  • 165
  • 309

1 Answers1

6

The maintainers of the package need to update the package to include a NAMESPACE file.

That said, you might have luck inserting the NAMESPACE file yourself as a hack. It looks like ASReml is closed source, but you have the .zip file. Try unzipping it. Then, create a simple text file containing:

exportPattern("^[^\\.]")

Save it as NAMESPACE (be careful that there is no extension like .txt, Windows sometimes sneaks these in). Place NAMESPACE in the top folder of the unzipped package (should be something like asreml.d/; there will also be a DESCRIPTION file there). If there is an MD5 file, you should probably delete it. Now, re-zip the asreml.d/ directory. See if the new zip file works.

For more on NAMESPACE, see http://cran.r-project.org/doc/manuals/R-exts.html#Package-namespaces .

NB This might be bad advice. But it seems like it would work. It won't hurt anything.

jthetzel
  • 3,603
  • 3
  • 25
  • 38
  • R 2.14.x will add a NAMESPACE file automatically if its not already in the package so the maintainers just need to rebuild it for R 2.14.x . For example, see: http://stackoverflow.com/questions/7998438/r-2-14-detect-packages-without-namespace – G. Grothendieck Nov 04 '11 at 19:09
  • @G. Grothendieck True, but would this work in the meantime, while MYaseen208 is waiting for maintainers to build with R 2.14.x? – jthetzel Nov 04 '11 at 19:12
  • Surely it would be easier to make no changes at all and just rebuild it under 2.14.x than to add a NAMESPACE and then rebuild it with 2.13.x. – G. Grothendieck Nov 04 '11 at 19:36
  • @jthetzel: Thanks for your reply. I did not get any error after followed your guidelines except this warning `Warning message: In readLines(file) : incomplete final line found on 'C:/Users/R/win-library/2.14/asreml.d/NAMESPACE'`. Any suggestion. – MYaseen208 Nov 04 '11 at 22:08
  • @MYaseen208 I think that warning is safe. Does the package load fine now? To prevent it in the future, perhaps make sure there are no blank lines at the end of the NAMESPACE file. – jthetzel Nov 04 '11 at 23:23
  • @G. Grothendieck I agree with you that the maintainers should just build it with 2.14.x. However, what I glean from OP is that only the Windows binary is available to OP (and not the source, as it is closed for this package), and that the maintainers cannot be relied upon to rebuild in a timely fashion. So, this answer is just a sub-optimal way to get buy for the moment. – jthetzel Nov 04 '11 at 23:31
  • @jhetzel, He hadn't mentioned that he did not have access to the source but if that is the case then I agree. – G. Grothendieck Nov 05 '11 at 03:33