Skip to content

79 new function install depricated package#80

Draft
SanderDevisscher wants to merge 23 commits into
mainfrom
79-new-function-install-depricated-package
Draft

79 new function install depricated package#80
SanderDevisscher wants to merge 23 commits into
mainfrom
79-new-function-install-depricated-package

Conversation

@SanderDevisscher

Copy link
Copy Markdown
Collaborator

Een helper functieje om depricated packages te installeren moesten ze bij de gebruiker ontbreken en ze vervangen is niet mogelijk door een gebrek aan een goed alternatief of door tijdsgebrek.

@SanderDevisscher SanderDevisscher added Function Issue related to a function New Nieuwe functie/data labels Sep 4, 2024
@SanderDevisscher SanderDevisscher self-assigned this Sep 4, 2024
@SanderDevisscher SanderDevisscher linked an issue Sep 4, 2024 that may be closed by this pull request
17 tasks
@SanderDevisscher SanderDevisscher marked this pull request as draft October 11, 2024 10:06
@SanderDevisscher SanderDevisscher marked this pull request as ready for review October 11, 2024 10:27

@soriadelva soriadelva left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

At the moment, I can't really test if the function works or not using the examples. The following adjustments would be needed:

  • I would include another package than sp in the examples. sp is required by fistools and will be already installed upon loading fistools. So if I uninstall it and restart the session, upon loading fistools sp is automatically installed again.
  • I would also include another package than maptools. There is no version of maptools for my current version of R (4.5.0). So I haven't been able to reinstall it after removing (although your function did work and brought me to the CRAN archive where I could pick one, there just isn't one availabel for R 4.5.0)
  • Depricated should be deprecated. This will need to be adjusted in all places where it is misspelled.
  • Again a few notes popping up "No visual binding for global variable...". Same fix as before.
  • I would adjust the print part at the end of the function to include two different options depending on wether the package was already installed or not (you expect it not to be installed, but in case it is, the function will not reinstall the package which may be in a different version than you wanted it to be and this is not shown as the message just says that the package is installed). In that case, I would useprint(paste0(package_name," (Version ", packageVersion(package_name),") is already installed")) and in the case that it was newly installed by the function I would use print(paste0(package_name," (Version ", packageVersion(package_name),") is installed \U0001F389"))
  • add utils:: before askYesNo and browsURL and add utils to Imports in the description file

@soriadelva

Copy link
Copy Markdown
Collaborator

I was also wondering if it may be useful to broaden the functionality of the function, so it can be used for installing a specific version of a package even when the package is not deprecated and it had been installed before? In the latter case, a pop-up could appear saying that a certain version of the package has already been installed and if you'd like to overwrite that (I'm saying this because I was in that situation when coding wiSDM)? I guess you can largely use the same rationale that has already been implemented?

@SanderDevisscher

Copy link
Copy Markdown
Collaborator Author

I was also wondering if it may be useful to broaden the functionality of the function, so it can be used for installing a specific version of a package even when the package is not deprecated and it had been installed before? In the latter case, a pop-up could appear saying that a certain version of the package has already been installed and if you'd like to overwrite that (I'm saying this because I was in that situation when coding wiSDM)? I guess you can largely use the same rationale that has already been implemented?

Good idea

@SanderDevisscher SanderDevisscher marked this pull request as draft July 4, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Function Issue related to a function New Nieuwe functie/data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NEW function] install depricated package

2 participants