$ R
R version 2.12.2 (2011-02-25)
Platform: i486-pc-linux-gnu (32-bit)
> install.packages("ggplot2", dep="T")
Error in apply(available[p1, dependencies, drop = FALSE], 1L, function(x) paste(x[!is.na(x)], :
subscript out of bounds
What can I do to install ggplot2?
The subscript out of limits error occurs because the fourth column of the matrix does not exist. If we don't know how many columns the matrix has, we can use the ncol() function to figure it out.
One common error you may encounter in R is: Error in x[, 4] : subscript out of bounds. This error occurs when you attempt to access a column or row in a matrix that does not exist.
Do read the help for functions! From ?install.packages
we have:
dependencies: logical indicating to also install uninstalled packages
on which these packages depend/suggest/import (and so on
recursively). Not used if ‘repos = NULL’. Can also be a
character vector, a subset of ‘c("Depends", "Imports",
"LinkingTo", "Suggests", "Enhances")’.
So this clearly states that you need to supply a logical value, a TRUE
or a FALSE
. "T"
is not a logical TRUE
and neither is T
really. Always spell out TRUE
and FALSE
otherwise you could get into lots of trouble. It isn't worth the hassle to save on a few keystrokes.
As I showed in the answer to the previous Q:
R> install.packages("ggplot2", dependencies = TRUE)
works. So why did you alter what I showed you did work?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With