Hi,
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 few forums, but I couldn't install. My Needs:
I have the zip file (the file used for installing the package) for the package and I need to view the entire script for the package. How do I do that?
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
At least this part doesn't seem to be related to the package code, this is only asking you to update the rest of your packages. After a mayor R update you have to update all your packages
Yes, you always have to do this after a major R update.
You have to update using checkBuilt = TRUE since they might be in the latest version but compiled under an older R version so you have to force reinstallation.
Hi andresrcs, I tried that as well, but didnt work. I was able to get the source file from the one who created the package. Can you please tell me how can I build a new version of that package in new version of R?
I went through this book. It explains about how to create a package. I did try to create a package. But it was not mentioned anything about how to rebuild and reload.
The load_all() function is arguably the most important part of the devtools workflow.
# with devtools attached and
# working directory set to top-level of your source package ...
load_all()
# ... now experiment with the functions in your package
load_all() is the key step in this “lather, rinse, repeat” cycle of package development:
Tweak a function definition.
load_all()
Try out the change by running a small example or some tests.
When you’re new to package development or to devtools, it’s easy to overlook the importance of load_all() and fall into some awkward habits from a data analysis workflow.
Thank you nirgramuk. Maybe my question is dumb. The link you shared explains load_all when the r package is opened.
I have the source file (R folder, description, namespace and others) in a folder in my desktop. My question is, how do I open this folder as a package in R so that I can make edits in functions/package version if required, then run check() and load_all() and then create the zip file.
@nirgrahamuk , I just figured out that i just give "Create_package("give teh path of teh folder that has package") and when I open it asks me if it needs to overwrite "description", "namesspace" ect.. I chose not to change. Then I was able to access the package folder. after making changes, i gave load_all, check() and will convert to binary file to share with others. This worked. Is there any other method?