similar to: is.matrix(), as.matrix, & as(,"matrix")

Displaying 20 results from an estimated 3000 matches similar to: "is.matrix(), as.matrix, & as(,"matrix")"

2004 Jan 04
0
termplot; failure to subset non-dataframe carriers (PR#6327)
termplot() does not carry subsetting over to carriers that are in the environment but not in the data frame. This generates a "subscript out of bounds" error. > data(ToothGrowth) > logdose <- log(ToothGrowth$dose) > tooth.lm <- lm(len ~ logdose, data=ToothGrowth) > termplot(tooth.lm) ## Works fine > toothVC2.lm <- lm(len ~ poly(dose,2),
2005 Oct 01
2
Multiple expressions, when using substitute()
expression() accepts multiple expressions as arguments, thus: plot(1:2, 1:2) legend("topleft", expression(y == a * x^b, "where "* paste(y=="wood; ", x=="dbh"))) Is there a way to do this when values are to be substituted for a and b? i.e., the first element of the legend argument to legend() becomes,
2005 Oct 13
1
arima: warning when fixing MA parameters.
I am puzzled by the warning message in the output below. It appears whether or not I fit the seasonal term (but the precise point of doing this was to fit what is effectively a second seasonal term). Is there some deep reason why AR parameters ("Warning message: some AR parameters were fixed: ...") should somehow intrude into the fitting of a model that has only MA terms? >
2005 Feb 22
1
Re: R-help Digest, Vol 24, Issue 22
You need to give the model formula that gave your output. There are two sources of variation (at least), within and between locations; though it looks as though your analysis may have tried to account for this (but if so, the terms are not laid out in a way that makes for ready interpretation. The design is such (two locations) that you do not have much of a check that effects are consistent over
2003 Mar 01
2
density(), with argument of length 1 (PR#2593)
The following is from version 1.6.2 of R under Windows, or 1.6.1 under Mac OSX/X11 > density(1) Error in if (!(lo <- min(hi, IQR(x)/1.34))) (lo <- hi) || (lo <- abs(x[1])) || : missing value where logical needed I am not sure how this should be handled. I encountered it in connection with densityplot(). In that connection, it might be enough to modify density() so that it
2004 Nov 10
1
Additions to the datasets package?
I have posted, at http://wwwmaths.anu.edu.au/~john/r/newsets/ image (.rda) files, and first stabs at .Rd files for various data on deaths in London from 1629 to 1939. (There are of course gaps.) The sources (Guy 1882 & Stocks 1942) are documented in the .Rd files: (1) poxetc: measles, smallpox & total deaths: 1629-1881 [I have deliberately left several inconsistencies that were in
2002 May 19
1
Hornet's Nests and Parallel Universes
Fisher is not the only person that it may be necessary to read 4 or 5 times. The same may be the case for side comments that Bill Venables is wont to make. Now to the parallel universe that I have in mind. I wonder whether the time is opportune for a list that focuses on "Statistical Methodology for R Users". The difference from other statistical methodology lists is that it will be
2004 Jan 24
1
Enhancement to termplot()
I'd like to make the following change to termplot(): Add panel=points as an extra parameter. Replace if (partial.resid) points(xx, pres[, i], cex = cex, pch = pch, col = col.res, ...) by if (partial.resid) panel(xx, pres[, i], cex = cex, pch = pch, col = col.res, ...) Also, I think, add col.smooth, span and iter as named parameters; see below.
2004 Nov 29
1
Call to trellis.focus(); thenpanel.superpose()
The following works fine with the x11 device, though it may well be that an initial plot is overwritten. With a pdf or postscript device, I get two plots, the first of which still has the red border from having the focus, while the second is the plot that I want. library(lattice); library(grid) plt <- xyplot(uptake ~ conc, groups=Plant, data=CO2) print(plt)
2005 Mar 30
1
Base and lattice graphics on the same graphics page
Although base graphics does not mix with lattice in the one graph, I've found that print.trellis(position=..., ) and the use of par(fig=...) to put regular and trellis graphics on the one graphics page works like a treat, at least in version 2.0.1 of R. [Base graphics functions that are themselves inconsistent with par(fig=...) are obviously disallowed.] I am wondering whether there are
2004 Nov 21
1
Location of grobs etc on lattice output
Is there any way, after use of print.trellis(), to obtain the co-ordinates of the plot region, e.g., in what are then the native co-ordinates? e.g. library(DAAG) library(lattice); library(grid) data(cuckoos) pushViewport(viewport(layout=grid.layout(2, 1))) pushViewport(viewport(layout.pos.row=1)) cuckoos.strip <- stripplot(species ~ length, data=cuckoos) print(cuckoos.strip,
2005 Apr 23
3
Enhanced version of plot.lm()
I propose the following enhancements and changes to plot.lm(), the most important of which is the addition of a Residuals vs Leverage plot. (1) A residual versus leverage plot has been added, available by specifying which = 5, and not included as one of the default plots. Contours of Cook's distance are included, by default at values of 0.5 and 1.0. The labeled points, if any, are those
2005 Feb 28
0
Re: R-help Digest, Vol 24, Issue 28
You've omitted a comma. races2000 is a data frame, which for purposes of extracting rows behaves like a 2-dimenional object. The following works fine: hills2000 <- races2000[races2000$type == 'hill', ] Additionally, you might like to ponder > type <- races2000[names(races2000)=="type"] > type[1:4] Error in "[.data.frame"(type, 1:4) :
2005 Sep 30
0
R-help Digest, Vol 31, Issue 30
With lme4, use of mcmcsamp can be insightful. (Douglas Bates drew my attention to this function in a private exchange of emails.) The distributions of random effects are simulated on a log scale, where the distributions are much closer to symmetry than on the scale of the random effects themselves. As far as I can see, this is a straightforward use of MCMC to estimate model parameters; it is not
2002 Nov 08
0
Fwd: RE: Macros versus functions
Typing in statements from the command line transfers to the computer a macro that was perhaps in the user's head. Putting together small sequences of carefully thought out code, in which key components have been carefully thought out and tested, has to be, for most of us, better than trying to make it all up on the run. An exception is necessary for those unusual people who who (akin to the
2002 Nov 11
0
Macros and functions
The following failed to make it to r-help when Murray Jorgensen sent his message a little time ago. [It seems to have been an issue of the machine from which my message originated.] Typing in statements from the command line transfers to the computer a macro that was perhaps in the user's head. Putting together small sequences of carefully thought out code, in which key components have been
2009 Sep 19
2
Use of R in Schools
I am looking for information on experimentation with the use of R in the teaching of statistics and science in schools. Any leads would be very welcome. I am certain that there is such experimentation. I've made this inquiry on r-sig-teaching, with no response. John. John Maindonald email: john.maindonald at anu.edu.au phone : +61 2 (6125)3473 fax : +61 2(6125)5549 Centre
2002 Jul 09
0
Re: Candid comment
<soap-box> While I agree with John about abuse of methodology, I can't subscribe to the "failure to read the manual" proposition. I don't mean to lecture, but it would seem to me that people who, like me, will probably gain far more from this list than we will be able to contribute (at least in the near term) owe it to those who will likely contribute far more than they
2010 Nov 15
2
L-shaped boxes with lattice graphs?
Can anyone suggest an equivalent, for lattice graphs, of the base graphics argument bty="l"? NB that I am leaving off the box around the strip, with a strip function: stripfun <- function(which.given,which.panel, factor.levels=as.expression(levlist), ...){ panel.text(x=0, y=0.5, lab = as.expression(levlist[which.panel[which.given]]),
2004 May 26
0
aggregate.formula
This relates to a message from Christophe Pallier to r-help some time ago. Like myself, he finds aggregate very useful, but the interface a little cumbersome. I've implemented a more compact formula interface, found at the bottom of this message: data(ToothGrowth) # I used to aggregate like this: aggregate(list(len=ToothGrowth$len),