Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 13, 2013
@talgalili Changing the output of installing stuff to become invisible. c82a69d
Commits on Mar 15, 2013
@talgalili os.shutdown - made to force shutdown
Also added some docs, and changed the return of TRUE/FALSE in install.URL to be invisible.
968ea94
View
5 NEWS
@@ -9,7 +9,7 @@ NEW FUNCTIONS ADDED:
UPDATED FUNCTIONS:
* install.Rtools - removed "latest_Frozen", added "check". Made the function know which Rtools to install based on your R version (and if it is not known - it asks the user to choose a version)
- * Removed shutdown (turned into os.shutdown)
+ * Removed shutdown (turned into os.shutdown), and made sure it uses "force" shutdown.
installR 0.8.5
@@ -146,4 +146,5 @@ TODO for future releases:
* update README.md for 0.8.5
* Add install.notepad and install.notepadpp
* Maybe add some timer to the os.manage functions. And also allow input for how long from x time to perform the action.
- * Add a rate function for the package
+ * Add a rate function for the package
+ * Add automatic check for a new R version every X time.
View
10 R/install.r
@@ -56,7 +56,7 @@ install.packages.zip <- function(zip_URL) {
#' @param keep_install_file If TRUE - the installer file will not be erased after it is downloaded and run.
#' @param wait should the R interpreter wait for the command to finish? The default is to NOT wait.
#' @param ... parameters passed to 'shell'
-#' @return TRUE/FALSE - was the installation successful or not. (this is based on the output of shell of running the command being either 0 or 1/2. 0 means the file was succesfully installed, while 1 or 2 means there was a failure in running the installer.)
+#' @return invisible(TRUE/FALSE) - was the installation successful or not. (this is based on the output of shell of running the command being either 0 or 1/2. 0 means the file was succesfully installed, while 1 or 2 means there was a failure in running the installer.)
#' @seealso \link{shell}
#' @export
#' @author GERGELY DAROCZI, Tal Galili
@@ -81,7 +81,7 @@ install.URL <- function(exe_URL, keep_install_file = FALSE, wait = TRUE, ...) {
# file.access(exe_filename, mode = 1)
# file.access(exe_filename, mode = 2)
# file.access(exe_filename, mode = 3)
- return(shell_output == 0)
+ return(invisible(shell_output == 0))
# error code 1/2 means that we couldn't finish running the file
# # 0 means - the file was succesfully installed.
}
@@ -284,7 +284,7 @@ ask.user.for.a.row <- function(TABLE,
#' @param use_GUI Should a GUI be used when asking the user questions? (defaults to TRUE)
#' @param page_with_download_url the URL of the RTools download page.
#' @param ... extra parameters to pass to \link{install.URL}
-#' @return TRUE/FALSE - was the installation successful or not.
+#' @return invisible(TRUE/FALSE) - was the installation successful or not.
#' @export
#' @source
#' Some parts of the code are taken from the devtools, see \url{https://github.com/hadley/devtools/blob/master/R/rtools.r}
@@ -309,8 +309,8 @@ install.Rtools <- function(choose_version = FALSE,
if(check & require(devtools)) { # if we have devtools we can check for the existance of rtools
found_rtools <- find_rtools()
if(found_rtools) {
- cat("No need to install Rtools - You've got the relevant version of Rtools installed")
- return(FALSE)
+ cat("No need to install Rtools - You've got the relevant version of Rtools installed\n")
+ return(invisible(FALSE))
}
}# if we reached here - it means we'll need to install Rtools.
View
6 R/os.manage.r
@@ -28,7 +28,11 @@ os.shutdown <- function(s=0, m=0, h=0) {
Sys.sleep(wait)
ifelse(is.windows(),
- shell("shutdown -s -t 0", wait = F),# without wait =F, the shuting down will not work properly since Windows will wait for R to close (which will be waiting for Windows to shutdown)
+ {
+ shell("shutdown -s -f -t 1", wait = F) # -f == forces the shutdown. And I give R 2 seconds to close.
+ quit("no")
+ }
+ ,# without wait =F, the shuting down will not work properly since Windows will wait for R to close (which will be waiting for Windows to shutdown)
system("shutdown -h now"))
}
View
5 R/updateR.r
@@ -144,6 +144,7 @@ install.R <- function(page_with_download_url = "http://cran.rstudio.com/bin/wind
#' @title Turns version to number (for 1 value only)
#' @param version_with_dots A character value - of the version of R (for example 2.15.2)
#' @return A "number" representation of the version (for example: 2015002)
+#' @seealso \link{turn.version.to.number}
#' @examples
#' \dontrun{
#' turn.version.to.number1("2.15.2")
@@ -163,8 +164,10 @@ turn.version.to.number1 <- function(version_with_dots) {
}
+
+### @aliases turn.version.to.number1
#' @title Turns version to number (for a vector of values)
-#' @param version_with_dots A character vector - of the version of R (for example 2.15.2)
+#' @param version_with_dots - A character vector - of the version of R (for example 2.15.2)
#' @return A vector of "numbers" representing the versions (for example: 2015002). The names of the vector is the original version character.
#' @examples
#' \dontrun{
View
3  man/install.Rtools.Rd
@@ -32,7 +32,8 @@
\link{install.URL}}
}
\value{
- TRUE/FALSE - was the installation successful or not.
+ invisible(TRUE/FALSE) - was the installation successful
+ or not.
}
\description{
Allows the user to choose, downloads and install - the
View
6 man/install.URL.Rd
@@ -18,9 +18,9 @@
\item{...}{parameters passed to 'shell'}
}
\value{
- TRUE/FALSE - was the installation successful or not.
- (this is based on the output of shell of running the
- command being either 0 or 1/2. 0 means the file was
+ invisible(TRUE/FALSE) - was the installation successful
+ or not. (this is based on the output of shell of running
+ the command being either 0 or 1/2. 0 means the file was
succesfully installed, while 1 or 2 means there was a
failure in running the installer.)
}
View
2  man/turn.version.to.number.Rd
@@ -5,7 +5,7 @@
turn.version.to.number(version_with_dots)
}
\arguments{
- \item{version_with_dots}{A character vector - of the
+ \item{version_with_dots}{- A character vector - of the
version of R (for example 2.15.2)}
}
\value{
View
3  man/turn.version.to.number1.Rd
@@ -20,4 +20,7 @@
turn.version.to.number1("2.15.2")
}
}
+\seealso{
+ \link{turn.version.to.number}
+}

No commit comments for this range

Something went wrong with that request. Please try again.