similar to: Solutions to Exercises - Data Analysis & Graphics Using R

Displaying 20 results from an estimated 3000 matches similar to: "Solutions to Exercises - Data Analysis & Graphics Using R"

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
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
2000 Mar 03
0
"Data Analysis and Graphics Using R - An Introduction"
I've now processed this document through Acrobat software. The navigation keys in Acrobat Reader should now handle it properly. The other advantage is a dramatic reduction in size, to half a megabyte. The new file is http://wwwmaths.anu.edu.au/~johnm/r/r4dat-gr.pdf Data sets [use source() to access them from an R session] are in the same directory, i. e.
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) :
2001 Feb 27
0
Using R for Data ... (was "Data Analysis and ...")
I have posted a new version of my document on R. I have corrected a number of errors and moved much of the detailed material on data structures to follow the chapter on exploration of multivariate data. I have changed the name; it is now: Using R for Data Analysis and Graphics - An Introduction The new document lives at: wwwmaths.anu.edu.au/~johnm/r/usingR.pdf My web page has information
2012 Jan 24
1
Failure to get compactPDF to compact a pdf file
I am failing to get compactPDF to make any change to a pdf file that, a/c to the message from the CRAN upload site, can be very substantially compacted. Any ideas what may be wrong? I have also tried recreating the pdf file. I also tried R CMD build --resave-data --compact-vignettes DAAG The data files compact alright (but I get the 'significantly better compression' warning message
2011 Feb 04
1
keep.source when semicolons separate statements on the one line
The following is 'semicolon.Rnw' > \SweaveOpts{engine=R, keep.source=TRUE} > > <<xycig-A, eval=f, echo=f>>= > library(SMIR); data(bronchit); library(KernSmooth) > @ % > > Code for panel A is > <<code-xycig-A, eval=f, echo=t>>= > <<xycig-A>> > @ % Sweave("semicolon") yields the following 'semicolon.tex'
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,
2011 Apr 09
1
Compression of largish expression array files in the DAAGbio/inst/doc directory?
The inst/doc directory of the DAAG package has 6 files coral551.spot, ... that are around 0.85 MB each. It would be useful to be able to zip then, but that as matters stand interferes with the use of the Sweave file that uses them to demonstrate input of expression array data that is in the "spot" format. They do not automatically get unzipped when required. I have checked that
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? >
2007 Oct 30
1
postscript(), used from a pre R-2.6.0 workspace
I find that if start R-2.6.0 in a workspace with no .RData file, load one of my workspaces from R-2.5.1 or earlier into R-2.6.0, and then before doing anything else type postscript(file="z.ps"), I get:: > ls() character(0) > load(url("http://www.maths.anu.edu.au/~johnm/r/test5.RData")) > postscript(file="z.ps") Error in postscript(file = "z.ps")
2010 Nov 25
1
\Sweaveopts error
I have a file 4lmetc.Rnw, intended for inclusion in a LaTeX document, that starts: \SweaveOpts{engine=R, keep.source=TRUE} \SweaveOpts{eps=FALSE, prefix.string=snArt/4lmetc} The attempt to process the file through Sweave generates the error: > Sweave("4lmetc") Writing to file 4lmetc.tex Processing code chunks ... 1 : keep.source term verbatim Error in file(srcfile$filename, open =
2011 Jun 29
1
R-devel Digest, Vol 100, Issue 28
I get the same style of path as Hadley. This is on Windows 7 Home Premium with SP1. I start R by clicking on the R-2.31.0 icon. I'd assumed that it was a change that came with R-2.13.0! (On 32-bit Windows XP, which I have just checked, I do indeed get the 8.3 paths.) > R.home() [1] "C:/Programs/R/R-2.13.0" > sessionInfo() R version 2.13.0 (2011-04-13) Platform:
2010 Dec 21
1
Bug report 14459 -- procedure for handling follow-up issues
Although the specific behaviour that was reported has been fixed, bugs remain in Sweave's processing of comment lines when keep.source=TRUE This is in some senses a follow-up from earlier bugs. Hence the query -- what is the preferred procedure, to submit a new bug report? (Another option might be to add a comment to the web page for bug 14459.) Is there now a preference to submit via
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]]),
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
2005 Feb 21
1
is.matrix(), as.matrix, & as(,"matrix")
Under help(matrix) it is written: 'is.matrix' tests if its argument is a (strict) matrix. It is generic: you can write methods to handle specific classes of objects, see InternalMethods. Further down, under "Details", the meaning of "strict" is explained more explicitly: 'is.matrix' returns 'TRUE' if 'x' is a matrix
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
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
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.