similar to: Help needed in reproducing a plot

Displaying 20 results from an estimated 2000 matches similar to: "Help needed in reproducing a plot"

2009 Oct 30
1
How to properly shade the background panels of an xyplot?
Dear R users, this is a follow up of this message http://tolstoy.newcastle.edu.au/R/e6/help/09/05/13897.html I'm reproducing the core of it for convenience. > // > / data(Oats, package = "MEMSS") / > / tp1.oats <- xyplot(yield ~ nitro | Variety + Block, / > / data = Oats, / > / panel = function(x, y, subscripts, ...) { /
2009 Oct 10
1
lattice auto.key drop unused levels
The following code produces a legend ("key") that mentions the unused levels of Block. library(MEMSS) xyplot(yield~nitro, subset=(Block=="I" | Block=="II"), data=Oats, group=Block, auto.key=T) and adding "drop.unused.levels=T" does not fix it. And in fact even the following does not solve the problem: xyplot(yield~nitro,
2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argument understands that "Variety" is a variable in the data. But the "scales" argument does not understand that "nitro" is a variable in the data.
2011 Oct 13
3
Create order of numbers based on a given vector
Hello! If I have a vector vec <- c(FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE FALSE) I can I create the following order of numbers based on vector vec: 1, 2, 2, 3, 3, 3, 4, 5 Whenever there is a FALSE I increase the number (starting with 1). Whenever there is a TRUE I set the same number as the previous FALSE has been assigned to. I would be happy for any input Cheers, Syrvn -- View
2007 Apr 27
1
Example of mcmcsamp() failing with lmer() output
Hi, I would appreciate help with the following model <<1>>= gunload <- read.table(hh('datasets/gunload.dat'), header = T) gunload$method <- factor(gunload$method, labels = c('new', 'old')) gunload$physique <- factor(gunload$group, labels = c('slight', 'average', 'heavy')) gunload$team9 <- factor(rep(1:9, each = 2)) @ This
2012 Feb 23
2
extract subset of data.frame
Hello, consider the following data.frame df and vector v df <- data.frame(group = c("A","B","C","D"), value = c(1,2,3,4)) v <- c(2,3) How can I return a sub data.frame which has only the rows left where value matches v df: group value B 2 C 3 Cheers -- View this message in context:
2011 Oct 06
3
Duplicate elements of a vector
Hi, let's assume I have the following vector a: 1 5 23 How can I use R to duplicate the elements so that my new vector looks like: 1 1 5 5 23 23 Many thanks, Syrvn -- View this message in context: http://r.789695.n4.nabble.com/Duplicate-elements-of-a-vector-tp3879561p3879561.html Sent from the R help mailing list archive at Nabble.com.
2009 Dec 08
3
re-ordering x-lables using barchart()
Hi R Users, I'm trying to re-order the "site names" ("Waseca", "Morris", ...). I'm using following code: libarry(lattice) barchart(yield ~ variety | site, data = barley, groups = year, layout = c(6,1), aspect=.7, ylab = "Barley Yield (bushels/acre)", scales = list(x = list(abbreviate = TRUE, rot=45,
2010 Jan 22
4
Rotating the axis labels in the basic graphic device ?
Hello dear R help group, I learned recently that one can change the rotation of labels in the axis, when using a lattice plot, for example: library(lattice) barchart(yield ~ variety , data = barley, groups = year, ylab = "Barley Yield (bushels/acre)", scales = list(rot = 45)) My question is: Is there an application of "rot" in something like
2006 Jan 25
2
panel function with barchart (lattice)
Folks at R help, I can't quite get the panel function to work the way I want within barchart. I guess I'm still not understanding how to piece together multiple panel arguments, especially when "groups" is specified. Example: I want to be able to add the value of "yield" to each section of each bar in this graph: barchart(yield ~ variety | site, data = barley,
2011 Aug 23
3
R system command does not work with objects/variables
Hello! with the R system command I would like to call a perl script which needs an input directory and an output directory in form of a path. When I put in the path directly it works. The script line looks as follows: system("perl '../path1' '../path2' '../path3'") If I store the path in a variable/object and call the perl script again it does not run and I
2011 Nov 15
2
Extract pattern from string
Hello, with Sys.time() you get the following string: "2011-11-15 16:25:55 GMT" How can I extract the following substrings: year <- 2011 month <- 11 day_time <- 15_16_25_55 Cheers, Syrvn -- View this message in context: http://r.789695.n4.nabble.com/Extract-pattern-from-string-tp4073432p4073432.html Sent from the R help mailing list archive at Nabble.com.
2010 Sep 03
5
how to get row name of matrix when result is a vector
Hi, the R code: a <- matrix(c(1,5,4,3,7,10,34,4,3,8,6,5,12,17,45,3,2,45,46,47,3,4,22,12,21), nrow=5) rownames(a) <- c("a","b","c","d","e") a a[which(a[,3] < 8), ] a[which(a[,3] < 6), ] produces the following output: > a [,1] [,2] [,3] [,4] [,5] a 1 10 6 3 3 b 5 34 5 2 4 c 4 4 12 45 22 d
2011 Oct 04
1
texi2dvi problem when compiling incorrect Latex code
Hello, I am working on a big R project using Eclipse/StatET/Texlipse. I'd like to write a Latex document within that project but DO NOT want to Sweave it. It's pure Latex. Via the external tools configurations I set up 2 different versions to ensure that my latex document is processed correctly. Version 1 (System Call): library(tools) setwd("${container_loc}") file =
2011 Nov 26
1
dir.create() does not create directory
Hello, I am running Windows 7 and R-2.13 in StatET. When I try to create a directory it does not print any errors but if I check outside eclipse if it exists or do a refresh in Eclipse the directory is not been created. The strange thing is that it happens only to some sub-folders... On the other hand when I use the normal windows explorer in one of these sub-folders and create a folder it
2005 Jun 01
1
font size in the trellis plot
>library(lattice) >dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL) and i get the plot whose font overlaps .what parematers should i change.(i do not want to change the size of the plot).
2007 Jan 30
1
change plotting symbol for groups in trellis graph
Hi, how can I change the plotting symbol for the groups in a trellis panel dotplot. My graph is similar to: library(trellis) dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL) I'd like to
2011 Sep 29
1
simplest pgfSweave example results in error
Hello, since 3 days now I try to get pgfSweave running using Eclipse + StatET. I created a super simple .Rnw file which can be viewed here: http://www.text-upload.com/read.php?id=147992&c=6441045 test.Rnw When I use sweave it works perfectly fine but when I use pgfSweave I get an error. The R output can be viewed here: http://www.text-upload.com/read.php?id=147995&c=3804886 R output
2011 Oct 13
8
Remove specific rows in a matrix/data.frame
Hi, imagine the following matrix/data.frame Letter Number a 1 a 1 b 1 b 0 c 0 c 1 d 0 d 0 If the numbers for two identical letters are also identical then I want to remove either the first or the second row of that letter. If for a letter the numbers are 1 and 0 I want to remove the row with the 0. That means if the code works I would and up with the following matrix/data.frame Letter
2012 Jul 08
3
list.files() find files beginning with a .
Hello, when I use list.files with recursive = TRUE and all.files = TRUE, R returns a list of strings/paths. >From all those strings I want to keep only the ones starting with a . I tried using grep to achieve that. However, the problem is that because of the recursive list.files parameter, for some files beginning with a . there is a path attached. I think it is not as simple as it looks