similar to: Function for subset of cases/lines

Displaying 20 results from an estimated 2000 matches similar to: "Function for subset of cases/lines"

2008 Dec 23
1
Borders for rectangles in lattice plot key
Hopefully an easy question. When drawing a rectangles in a lattice plot key, how do you omit the black borders? Here is an example adapted from one on the xyplot help page: bar.cols <- c("red", "blue") key.list <- list( space="top", rectangles=list(col=bar.cols), text=list(c("foo", "bar")) ) barchart( yield ~ variety | site,
2007 Dec 19
1
Different labels by panel in barchart
Dear all, I'm analysing a survey, and creating a barchart of the different responses for each question. The questions are grouped according to a number of categories, so I'm using lattice to create a plot with each question in a category on it. The problem is that the response set for different questions within the same category varies. I want to be able to draw only the relevant
2009 Jan 09
1
Saving plots as byte streams
Is it possible to save plots as byte streams? For example, if I want the bytes for a PNG plot, I could use #Write the plot to a PNG file png("test.png") plot(1:10) dev.off() #Read the bytes back in from the file plotbytes <- readBin("test.png", "raw", n=2000) Ideally, I'd like to avoid having to bother writing to the file in the first place, and simply
2009 Jan 12
2
R2WinBUGS stopping execution
Apologies if this isn't acceptable for the general help list. I'm running OpenBUGS model via the R2WinBUGS package interface, under Windows. Is it possible to terminate running models, short of using the Windows Task Manager to forcibly exit the program? Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes, I know that multiple y-axes are generally a bad idea; the graph is for someone else and they want it that way.) I've used a custom yscale.component in xyplot to achieve this: myyscale.component <- function(...) { ans <- yscale.components.default(...) ans$right <- ans$left foo <-
2008 Sep 26
2
adjusting textsize and spacing in mosaic (vcd package)
I'm trying to find a way to change the font size in a mosaic plot (the grid version, not the base graphics one). Here's an example to demonstrate: #Basic plot library(vcd) mosaic(HairEyeColor, shade = TRUE) #Bad first guess: this stops the default cell colouring, and doesn't change the font size mosaic(HairEyeColor, shade = TRUE, gp=gpar(fontsize=16)) #This successfully changes
2009 Nov 16
2
n=1 default for random number generators
One tiny thing that would be very nice to have is a default value of n=1 in the random number generator functions, enabling, e.g., runif() instead of runif(1). This won't break anyone's existing code and ought to be relatively straightforward to do. Is there anyone in the core team who would be willing to include this change? ----- Regards, Richie. Mathematical Sciences Unit HSL --
2008 Sep 05
1
controlling lattice plot ticks with relation="free"
How do you persuade lattice to draw tick marks on both the left and right side of the y-axis, when relation="free" in the scales component? #Ticks appear on both sides histogram(~height|voice.part, data=singer) ##Ticks only on left histogram(~height|voice.part, data=singer, scales=list(y=list(relation="free"))) Providing tck as a vector of length 2 doesn't seem to
2008 May 13
0
add horizontal line "(ABLINE(V=))" to xyplot lattice
> In a lattice plot like this: > > win.graph() > xyplot(tmx~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm), > data=tmx,type="l",pch=16,xlab="frequency (N)",ylab="Area held (ha)", > auto.key=list(blm,points=F,lines=T,title="Blm factor",cex.title=0.7, > cex=0.7,corner=c(1,1)),main="Mangroves target=1573ha",layout=c(2,3))
2009 Jun 19
0
RGui Configuration Editor crashes when using an unlisted font
I am using R2.9.0 under Windows XP SP 2 (32-bit). I just discovered a rather excellent programming font (http://www.dafont.com/bitstream-vera-mono.font). Since it isn't one of the fonts listed as an option in the RGui Configuration Editor, I manually editted my RConsole file font line to font = Bitstream Vera Sans Mono When I opened R, the text in the console displayed correctly, but
2008 Sep 01
0
tryCatch
> I am trying to debug a program, and I think tryCatch will help. The > functions involved > process through so many times before I encounter the error, things > are a bit slow to > use debug and browser(). > > I've read the help file and postings on conditions, and am still > having trouble. > > While running my program I am getting a NAN from a called
2008 Oct 17
1
Using key.opts in Ecdf/labcurve (Hmisc package)
I'm presumably missing something very obvious, but how does one use the key.opts argument in labcurve (via Ecdf)? In this example, I want the key to be big and have a blue background, but it isn't and doesn't. ch <- rnorm(1000, 200, 40) sex <- factor(sample(c('female','male'), 1000, TRUE)) Ecdf(~ch, group=sex, label.curves=list(keys=c("f",
2006 Jan 18
1
Powell's unconstrained derivative-free nonlinear least squares routine, VA05AD
I have used Mike Powell's optimization routine (VA05AD) from the Harwell Subroutine Library (HSL) for more than 20 years. It is no exaggeration to say that it has helped make my career (thanks Mike). I recently learned that I am not alone in this respect - apparently it still has a loyal following in all sorts of fields! It is an exceedingly fine piece of software - fast, reliable and easy to
2004 Oct 19
2
Sweave and Trellis in R 2.0.0patched (Windows)
I've been using the following code to plot using Sweave in version 1.9.1 library(RODBC) library(lattice) channel <-odbcConnectExcel("h:/water.xls") data <- sqlQuery(channel,"select * from `Sheet1$` where Test = 'TOC' and (Valve='5010-05' or Valve='8030-V26' or Valve='1180-08' or Valve='5040-08')") odbcClose(channel) srt <-
2005 Mar 16
1
Code to replace nested for loops
Dear list members, How can I replace the nested for loops at then end of the script below with more efficient code? # Begin script__________________________________________________ # Dichotomous scores for 100 respondents on 3 items with # probabilities of a correct response = .6, .4, and .7, # respectively x1 <- rbinom(100,1,.6) x2 <- rbinom(100,1,.4) x3 <- rbinom(100,1,.7) #
2009 Aug 31
1
package installation error
On Sun April 19, you posted the following on R-help: > After installing 2.9.0 I tried loading packages, but keep getting the following error. > > package 'robustbase' successfully unpacked and MD5 sums checked > Error in normalizePath(path) : > path[1]="C:\Program Files\R\R-2.9.0\library/robustbase": The system cannot find the file specified > I have had the
2006 Oct 31
5
Odd behaviour of removing 'nothing' from an array or data frame
I've just found some behaviour which strikes me as odd, but I'm not sure whether it's a bug or a feature. If you don't mind, I'd like to explain via a couple of examples. Let x = 1:10. Then intuitively, to me at least, the command x[-integer(0)] should leave x untouched. However the actual output under R2.4.0 is integer(0). A slightly more involved example demonstrates
2004 Dec 21
3
R code for var-cov matrix given variances and correlations
Dear list members, Where can I find code for computing the p*p variance-covariance matrix given a vector of p variances (ordered varA, varB, ..., varp) and a vector of all possible correlations (ordered corAB, corAC, ..., corp-1,p)? I know that the covariance between 2 variables is equal to the product of their correlation and their standard deviations: corAB * varA^.5 * varB^.5 and so:
2007 Nov 26
0
14 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_file_reference.c libswfdec/swfdec_load_object.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_system_security.c test/trace
libswfdec/swfdec_as_object.c | 64 libswfdec/swfdec_file_reference.c | 2 libswfdec/swfdec_load_object.c | 81 libswfdec/swfdec_sprite_movie_as.c | 19 libswfdec/swfdec_system_security.c | 1 test/trace/Makefile.am | 72
2017 Nov 03
0
[PATCH v17 2/6] radix tree test suite: add tests for xbitmap
From: Matthew Wilcox <mawilcox at microsoft.com> Add the following tests for xbitmap: 1) single bit test: single bit set/clear/find; 2) bit range test: set/clear a range of bits and find a 0 or 1 bit in the range. Signed-off-by: Wei Wang <wei.w.wang at intel.com> Cc: Matthew Wilcox <mawilcox at microsoft.com> Cc: Andrew Morton <akpm at linux-foundation.org> Cc: Michael S.