0

I have a package that was developed by one of my colleague and she left the organization. The package was developed on R version 3.3.0 and it works fine with R 3.x.x. However when I try to install it in R 4.1.0, I get below error.

Error: package or namespace load failed for "xxxx": package "xxxx" was installed before R 4.0.0: please reinstall it

I tried multiple ways that was suggested by stack overflow members, but I couldn't install.

My Needs:

  1. I have the zip file for the package and I need to view the entire script for the package and edit it. How do I do that?

  2. What edits should I do to enable this package to work on R 4.1.0?

Any help would be appreciated. Thank you in advance

Kannu
  • 43
  • 4
  • 1
    What do you mean by the "zip file" for the package? If the tarball, can install directly from that. If of the source, you can follow what's described [here](https://stackoverflow.com/questions/30989027/how-to-install-a-package-from-a-download-zip-file) (installing from tarball is part of that process). You should just need to re-install, highly unlikely there are parts of the package that need adjusting, and if there is, beyond the scope of this question. – caldwellst Aug 13 '21 at 13:21
  • 1
    You’ll need to check whether there’s a DLL file inside the ZIP. If so, you’re out of luck. Otherwise there might be ways of reconstructing the package source. — Honestly, though, I’d instead try finding the author of the package (inside your R v3, run `packageDescription("thepackage")`, that should give you an email address; alternatively, unpack the `DESCRIPTION` file from the ZIP, it has the same information), and contact them. – Konrad Rudolph Aug 13 '21 at 13:27
  • Thank you for your time @caldwellst. I will use this method to install the package in R 4.1.0. Now, I need to know how to edit the existing package and save it as an updated package. I actually have this package installed in R 3.6.3. I want to make few changes in the functions of this package. So, i would like to understand how to edit the source code and make changes in the function. – Kannu Aug 13 '21 at 13:30
  • @KonradRudolph, thank you for the suggestion. Luckily, the DLL file is not in my package and the author is super busy with her new organization. If you could guide me about how to edit the package, that would really help! – Kannu Aug 13 '21 at 13:35
  • @Suganya Too busy to just send the source code of the package? She *should* have left that behind at the old organisation anyway, shouldn’t she? That way is going to be a lot simpler than trying to reconstruct the source code from an R package, especially via Stack Overflow. – Konrad Rudolph Aug 13 '21 at 13:43
  • @KonradRudolph, by source code, do you mean she should have a R script that has the entire script for the package? so she just converted this script to a package that could be used by everyone? – Kannu Aug 13 '21 at 13:51
  • 1
    @Suganya No, the package source isn’t a single script. It’s a project folder. Anyway, the ZIP file you hold doesn’t contain the source code, it only contains the compiled package. Recovering the source code from it, if at all possible, is definitely not trivial and would require fairly in-depth knowledge of R. Even then it’s not a trivial task, otherwise I’d write an answer. But I’d need to try it myself first, and doing that, and then writing up an easy to follow explanation, would take several hours. – Konrad Rudolph Aug 13 '21 at 14:21

0 Answers0