Skip to content

Add updatePackage command#532

Merged
renkun-ken merged 4 commits intoREditorSupport:masterfrom
ManuelHentschel:updatePackage
Jan 25, 2021
Merged

Add updatePackage command#532
renkun-ken merged 4 commits intoREditorSupport:masterfrom
ManuelHentschel:updatePackage

Conversation

@ManuelHentschel
Copy link
Copy Markdown
Member

What problem did you solve?
#529

How can I check this pull request?
This PR adds a command Update/reinstall package to the package tree view that reinstalls/updates the package. This is done by a simple call to install.packages('PKG_NAME') and does not check if the package is installed from CRAN and does not compare versions.

@renkun-ken
Copy link
Copy Markdown
Member

Looks like the update button already works with single package.

I'm wondering if it makes sense to add similar to

image

so that it is easier to update all installed packages by executing something like update.packages(ask=FALSE)?

@ManuelHentschel
Copy link
Copy Markdown
Member Author

I added a command button to the entry Install CRAN Package (I felt it fits better there, since the other commands next to Help topics by Package only affect the tree view but don't install/modify any actual packages).

As you suggested, the command executes update.packages(ask=FALSE, repos=<CRAN_URL>). On my machine this worked for most packages but some packages seem to cause problems. I think this is caused by them being loaded somewhere, so that their .DLL files cannot be overwritten. I don't think there is a simple solution for this, so I wouldn't try to fix this, but if you have any ideas, feel free to push/suggest a fix.

@renkun-ken
Copy link
Copy Markdown
Member

I added a command button to the entry Install CRAN Package (I felt it fits better there, since the other commands next to Help topics by Package only affect the tree view but don't install/modify any actual packages).

Yes, makes good sense.

As you suggested, the command executes update.packages(ask=FALSE, repos=<CRAN_URL>). On my machine this worked for most packages but some packages seem to cause problems. I think this is caused by them being loaded somewhere, so that their .DLL files cannot be overwritten. I don't think there is a simple solution for this, so I wouldn't try to fix this, but if you have any ideas, feel free to push/suggest a fix.

I think it is a known issue in Windows. I guess we could leave it as is at the moment.

Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@renkun-ken renkun-ken merged commit fcc4999 into REditorSupport:master Jan 25, 2021
@ManuelHentschel ManuelHentschel deleted the updatePackage branch January 25, 2021 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants