-
Notifications
You must be signed in to change notification settings - Fork 29k
[MINOR][R] small tidying of sh scripts for R #28419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,13 @@ SPARK_ROOT_DIR <- as.character(argv[1]) | |
| LOCAL_LIB_LOC <- file.path(SPARK_ROOT_DIR, "R", "lib") | ||
|
|
||
| # Checks if SparkR is installed in a local directory. | ||
| if (! library(SparkR, lib.loc = LOCAL_LIB_LOC, logical.return = TRUE)) { | ||
| if (!requireNamespace("SparkR", lib.loc = LOCAL_LIB_LOC)) { | ||
| stop("You should install SparkR in a local directory with `R/install-dev.sh`.") | ||
| } | ||
|
|
||
| # Installs lintr from Github in a local directory. | ||
| # NOTE: The CRAN's version is too old to adapt to our rules. | ||
| if ("lintr" %in% row.names(installed.packages()) == FALSE) { | ||
| devtools::install_github("jimhester/[email protected]") | ||
| # Installs lintr if needed | ||
| if (!requireNamespace("lintr")) { | ||
| install.packages('lintr') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there was sort of a reason for installing a particular version: #26564 (comment) But the logic seems to be "use the new 2.0.0 version". This would always pick up the latest. I'm guessing that's OK, @dongjoon-hyun ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment said the CRAN version wasn't recent enough so I assumed Anyway, yes, would be good to confirm on this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya. It looks okay since this seems to install lintr 2.0.1 as of today. |
||
| } | ||
|
|
||
| library(lintr) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems fine but I don't know these commands; any potential behavior change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requireNamespaceis a more minimal test to be suredevtools::will work correctly.This is the more common route to check for available functionality, e.g. for Suggested (not required) packages. this is how the suggested
arrowdependency is handled, for example:The
installed.packagesis much more cumbersome -- it looks up the full set of available packages, then searches to see if this particular one is there.