Permalink
Browse files

Added install.ImageMagick

Also updated README a bit.
  • Loading branch information...
1 parent 06da019 commit 36b7da36c78d97c3fce94775f24be94b37eae74f @talgalili committed Mar 9, 2013
Showing with 104 additions and 10 deletions.
  1. +1 −0 NAMESPACE
  2. +2 −1 NEWS
  3. +37 −2 R/install.r
  4. +25 −6 README.md
  5. +38 −0 man/install.ImageMagick.Rd
  6. +1 −1 man/install.RStudio.Rd
View
@@ -6,6 +6,7 @@ export(file.name.from.url)
export(get.installed.R.folders)
export(install.git)
export(install.GitHub)
+export(install.ImageMagick)
export(install.MikTeX)
export(install.packages.zip)
export(install.pandoc)
View
3 NEWS
@@ -8,6 +8,7 @@ NEW FUNCTIONS ADDED:
* is.RStudio - checks if the current R session is running within RStudio or not.
* is.Rgui - checks if the current R session is running within Rgui or not.
* add.installr.GUI and remove.installr.GUI - for adding a menu system to Rgui
+ * install.ImageMagick.
UPDATED FUNCTIONS:
* install.URL -
@@ -129,6 +130,6 @@ TODO for future releases:
-------------------------
* uninstall.R() for the old version of R (including the library folder)
* Better integration with the "global library" strategy
- * update RTools to be smarter about how to ask the user what to choose.
+ * update RTools to be smarter about how to ask the user what to choose. Also check if the Rtools is already installed or not (devtools has such a function)
* update README.md for 0.8.5
View
@@ -370,7 +370,7 @@ install.MikTeX <- function(version, page_with_download_url="http://miktex.org/d
#' @export
#' @references
#' \itemize{
-#' \item RStudio homepage: \url{http://www.rstudio.com//}
+#' \item RStudio homepage: \url{http://www.rstudio.com/}
#' \item devtools::source_url \url{http://rgm3.lab.nig.ac.jp/RGM/r_function?p=devtools&f=source_url}
#' }
#' @examples
@@ -391,7 +391,40 @@ install.RStudio <- function(page_with_download_url="http://www.rstudio.com/ide/
install.URL(URL)
}
-# install.RStudio()
+
+
+
+#' @title Downloads and installs ImageMagick for windows
+#' @description Allows the user to downloads and install the latest version of ImageMagick for Windows.
+#' @details
+#' ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
+#' This function downloads Win32 dynamic at 16 bits-per-pixel.
+#' @param page_with_download_url the URL of the ImageMagick download page.
+#' @return TRUE/FALSE - was the installation successful or not.
+#' @export
+#' @references
+#' \itemize{
+#' \item ImageMagick homepage: \url{http://www.imagemagick.org/script/index.php}
+#' }
+#' @examples
+#' \dontrun{
+#' install.ImageMagick() # installs the latest version of git
+#' }
+install.ImageMagick <- function(page_with_download_url="http://www.imagemagick.org/script/binary-releases.php") {
+ # get download URL:
+ page <- readLines(page_with_download_url, warn = FALSE)
+ # http://www.imagemagick.org/download/binaries/ImageMagick-6.8.3-8-Q16-x86-dll.exe
+ pat <- "//www.imagemagick.org/download/binaries/ImageMagick-[0-9.]+-8-Q16-x86-dll.exe";
+ target_line <- grep(pat, page, value = TRUE);
+ m <- regexpr(pat, target_line);
+ URL <- regmatches(target_line, m) # (The http still needs to be prepended.
+ URL <- paste('http', URL, sep = ':')[1] # we might find the same file more than once - so we'll only take its first one
+
+ # install.
+ install.URL(URL)
+}
+
+
@@ -529,6 +562,7 @@ installr <- function(use_GUI = TRUE, ...) {
"MikTeX",
"pandoc",
"GitHub",
+ "ImageMagick",
"Cancel")
the_answer <- menu(choices, graphics = use_GUI, title = "Which software (for Windows) would you like to install?")
@@ -541,6 +575,7 @@ installr <- function(use_GUI = TRUE, ...) {
install.MikTeX(),
install.pandoc(),
install.GitHub(),
+ install.ImageMagick(),
return(FALSE)
)
}
View
@@ -1,12 +1,36 @@
# installr
+## Introduction
+
The *installr* package offers a set of R functions for the installation and updating of software (currently, only on Windows OS), with a special focus on R itself. This package has two main goals:
1. To make updating R (on windows) as easy as running a function.
2. To make it easy to install all of the needed software for R development (such as git, and RTools), and reproducible research using R (such as MikTeX and pandoc), as easy as possible.
+## Installation
+
+To install the stable version on CRAN:
+
+```r
+install.packages('installr')
+```
+
+To install the GitHub version:
+
+```r
+if (!require('devtools')) install.packages('devtools')
+install_github('installr', 'talgalili')
+```
+
-The available functions are:
+## Contact
+
+You are welcome to submit suggestions and bug-reports at: <https://github.com/talgalili/installr/issues>
+Pull requests are welcome on: <https://github.com/talgalili/installr/>
+And any friendly e-mail to: <tal.galili@gmail.com>
+
+
+## Available functions are:
* updateR() - serves as a "check for updates" function of R itself. Running the function will check for a newer version of R than the one currently used. If one exists, the function will download the most updated R version and run its installer. Once done, the function will offer to copy (or move) all of the packages from the old R library to the new R library. It will then offer to update the moved packages, offer to open the new Rgui, and lastely, it will quit the old R.
@@ -18,8 +42,3 @@ The available functions are:
* install.packages.zip() - for installing package from a url of a ZIP file. Currently, it is the only option I know of for downloading+installing a direct ZIP of an R package.
* install.URL() - gets a URL of a zipped file, and makes sure to download and run it.
-You are welcome to submit suggestions and bug-reports at: https://github.com/talgalili/installr/issues
-I also welcome patches on: https://github.com/talgalili/installr/
-And any friendly e-mail to: tal.galili@gmail.com
-
-
View
@@ -0,0 +1,38 @@
+\name{install.ImageMagick}
+\alias{install.ImageMagick}
+\title{Downloads and installs ImageMagick for windows}
+\usage{
+ install.ImageMagick(page_with_download_url = "http://www.imagemagick.org/script/binary-releases.php")
+}
+\arguments{
+ \item{page_with_download_url}{the URL of the ImageMagick
+ download page.}
+}
+\value{
+ TRUE/FALSE - was the installation successful or not.
+}
+\description{
+ Allows the user to downloads and install the latest
+ version of ImageMagick for Windows.
+}
+\details{
+ ImageMagick® is a software suite to create, edit,
+ compose, or convert bitmap images. It can read and write
+ images in a variety of formats (over 100) including DPX,
+ EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript,
+ SVG, and TIFF. Use ImageMagick to resize, flip, mirror,
+ rotate, distort, shear and transform images, adjust image
+ colors, apply various special effects, or draw text,
+ lines, polygons, ellipses and Bézier curves. This
+ function downloads Win32 dynamic at 16 bits-per-pixel.
+}
+\examples{
+\dontrun{
+install.ImageMagick() # installs the latest version of git
+}
+}
+\references{
+ \itemize{ \item ImageMagick homepage:
+ \url{http://www.imagemagick.org/script/index.php} }
+}
+
View
@@ -27,7 +27,7 @@ install.RStudio() # installs the latest version of git
}
\references{
\itemize{ \item RStudio homepage:
- \url{http://www.rstudio.com//} \item devtools::source_url
+ \url{http://www.rstudio.com/} \item devtools::source_url
\url{http://rgm3.lab.nig.ac.jp/RGM/r_function?p=devtools&f=source_url}
}
}

0 comments on commit 36b7da3

Please sign in to comment.