similar to: Extracting multiple elements from a list

Displaying 20 results from an estimated 10000 matches similar to: "Extracting multiple elements from a list"

2003 Nov 13
1
Can't get Sweave syntax highlighting with Emacs
I can't get Emacs to automatically do syntax highlighting of Sweave files. I have followed Friedrich's suggestion for code to insert into my .emacs file. The complete section from my .emacs file is given below. When I load a *.Snw file, font is white until I press M-x, then the first code and document chunks get highlighted, but not the rest of the file. Latex and Noweb menus are
2004 Oct 14
3
Problem with number characters
I am trying to process text fields scanned in from a csv file that is output from the Windows database program FileMakerPro. The characters onscreen look like regular text, but R does not like their underlying binary form. For example, one of text fields contains a name and a number, but R recognizes the number as something other than what it appears to be in plain text. The character string
2004 Jul 13
1
summary() doesn't work with Date class objects
The handy function summary() doesn't work correctly with Date class objects: > R.version.string [1] "R version 1.9.1, 2004-06-21" > b <- as.Date(c("2002-12-26", "2002-12-27", "2002-12-28", "2002-12-29", "2002-12-30")) > b [1] "2002-12-26" "2002-12-27" "2002-12-28" "2002-12-29"
2004 May 14
5
Tagging identical rows of a matrix
I would like to generate a vector having the same length as the number of rows in a matrix. The vector should contain an integer indicating the "group" of the row, where identical matrix rows are in a group, and a unique row has a unique integer. Thus, for a <- c(1,2) b <- c(1,3) c <- c(1,2) d <- c(1,2) e <- c(1,3) f <- c(2,1) mat <- rbind(a,b,c,d,e,f) I would
2010 Mar 03
2
Screen settings for point of view in lattice and misc3d
I'm making some 3D plots with contour3d from misc3d and wireframe from lattice. I want to view them from below; i.e. the negative z-axis. I can't figure out how to do so. I would like my point of view looking up from below, with the z, y, and x axes positive going away. Can anyone tell me the correct settings for screen to achieve this? Here is what I've found so far:
2005 Mar 02
1
Rounding parameter values in genoud(), Rgenoud package
I would like to limit the significant figures of the calibrated parameters determined by genoud() in the Rgenoud package. Below is some example output, where column 1 is model run number, columns 2-7 are the parameter values, and columns 8-12 are model fit statistics. I would like genoud to internally limit parameters to 4 decimal places as shown in this output. It is clear that the function is
2017 Aug 13
1
ggplot's aes_ doesn't work as expected for x=factor()
I'm learning how to use ggplot in a programming approach where I supply variable names on the fly. Using aes_ doesn't work as I expected when x = factor(x). Is this a bug or am I not understanding something? # toy dataset df <- data.frame(LogicalVar = c(FALSE, TRUE, FALSE, TRUE, FALSE, TRUE), Var1 = c(0.01, 0.01, 1, 1, 30, 30), pct1 = c(12, 88, 60,
2005 Apr 22
3
Problem with R-2.1.0: install.packages() doesn't work
I installed R-2.1.0 from source on a Linux box running Red Hat Enterprise Linux WS release 4 but install.packages() wouldn't work (see below). When I install R-2.0.1 from RPM on the same system, everything is fine. Version 2.1.0 (2005-04-18), ISBN 3-900051-07-0 . . . > options(CRAN = "http://cran.fhcrc.org/") > install.packages("rgenoud") --- Please select a CRAN
2006 Jun 27
3
Possible to get a definition of a function from a package to use without invoking the package?
Hi, I often use the mod() and instring() functions that are available in the clim.pact package. This package has a lot of dependencies, including installation of netCDF, and I haven't yet been able to get library(clim.pact) to work on a Mac OS 10.4.6. A previous request for help with the Mac problem yielded no results, so now I wonder if I could just extract the definitions for the couple
2008 Oct 13
2
Using an image background with graphics
I would like to use a map or aerial photo as a background to plotting solid lines and text, and semi-transparent color contours, in base and lattice graphics. Plot coordinates need to be consistent with the georeferenced background. For example, a color contour plot would have an gray-toned aerial photograph as a background for overprinted semi-transparent color contours of some spatially
2010 Feb 11
2
Using contour3d: axes, plotting to file, with lattice
I am looking for examples of how to plot with contour3d() to a PNG or PDF file, add axes and other elements to the isosurface plot, and use contour3d in conjunction with lattice. Regarding lattice, I'm not necessarily looking for conditioning on the data shown in the isosurface plots, just a way to show multiple plots in one figure and label them. I am new to the packages misc3d and rgl.
2002 Mar 27
2
Vertical bars with barchart()
I would like to create a barchart that has vertical instead of horizontal bars. My goal is something similar to Figure 6.10 (p. 166) in "The Basics of S and S-plus," except for the orientation of the bars. I don't think bwplot() or xyplot() will work. Any suggestions? Scott Waichler Hydrology Group/Environmental Technology Division Battelle Pacific Northwest National Laboratory
2010 Apr 06
6
3-D response surface using wireframe()
I am working on plotting a response surface using wireframe(). The default style/orientation is z | | y | \ | \ | \ | \ | \ | \ | \ | \|________________x 0 Now what I want the orientation of axes is: z | | | |
2002 Aug 26
5
updating n within for(i in 1:n) loop
Hi folks: I think I'm having problems with figuring this one out: test1 <- function() { n <- 2 for(i in 1:n) { cat(paste("i =", i, "\n")); flush.console() n <- 5 # version 1 #n <<- 5 # version 2 #assign("n", 5, envir = environment(test1)) # version 3 } } I need the for(.) loop to run (say) n=5 times within the
2004 Jun 01
1
Making a ranking algorithm more efficient
I would like to make a ranking operation more efficient if possible. The goal is to rank a set of points representing objective function values such that points which are "dominated" by no others have rank 1, those which are dominated by one other point have rank 2, etc. In the example with two dimensions below, objective functions 1 and 2 are to be minimized. Points a-e are
2007 Apr 25
2
levelplot and unequal cell sizes
I am using levelplot() from lattice with grids that have unequal cell sizes. This means that the boundary between two cells is not always half-way between nodes, as levelplot() assumes. The result is that some cell sizes are rendered incorrectly, which can be painfully obvious if using relatively large cells. Is there any work-around? I am using the conditioning capability of lattice and
2017 Jun 21
0
customizing color key with plot3D
Karline, Thank you for your help. I discovered that in addition to including clim, I needed to omit breaks. This code uses one of your other examples as a starting point and works as intended: persp3D(z = volcano, zlim = c(-60, 200), phi = 20, colkey = list(length = 0.2, width = 0.4, shift = 0.15, cex.axis = 0.8, cex.clab = 0.85), lighting = TRUE, lphi = 90, clab =
2006 Jan 14
2
change lattice panel background color
I can't find a way to change just the panel background color in lattice. I would like NA regions in levelplot() to appear black. I've tried the trellis.par.set() stuff, but it it makes the background of the whole graphic black. Thanks, Scott Waichler Pacific Northwest National Laboratory scott.waichler _at _ pnl.gov
2002 Feb 06
1
dev.off() prematurely stops xyplot()
I have a script containing an xyplot() to print to a postscript file, followed by dev.off(). When I source the script, the dev.off() seems to cut off the xyplot() execution before it is finished. The resulting postscript file has about the right size, but it appears blank when I try to view it. If I manually execute the xyplot(), then wait for the return of the R prompt before executing
2004 Aug 31
4
Problem with seq.dates in chron
I get faulty output from seq.dates() if I specify a length that is too long. For example, I ask for 129 months in the following call to the function, but it returns 131: > R.version.string [1] "R version 1.9.1, 2004-06-21" > startdatetime <- chron(dates="01/01/1995", times="00:00:00") > beg.month.datetimes <- seq.dates(from=startdatetime,