similar to: grid.pack and grid.frame bewilder me

Displaying 20 results from an estimated 1000 matches similar to: "grid.pack and grid.frame bewilder me"

2011 Mar 04
1
Units and dimensions in grid object
Dear R-users, As far as I understand, when one defines the width of a rectGrob call using a 'npc' unit, the width of the object is proportional to the width of the current viewport. Is there a way to refer to the height (or width) of the viewport when defining the width (or height) of the rectGrob object? Thanks Sebastien [[alternative HTML version deleted]]
2011 Feb 15
1
gList and gTree methods of grid::grobX
Dear all, In an attempt to draw fill patterns in grid graphics, I have encountered a behavior of grobX that I cannot understand from the documentation. Consider this, library(grid) ## gTree g1 <- gTree(children=gList( rectGrob(0.5,0.5, width=unit(0.8,"npc"), height=unit(2,"cm")), circleGrob(r=0.3)), vp=viewport(0.5,0.5)) ##
2002 Jan 18
2
length of dimnames???
Hi: I have made a lot of progress reading and manipulating large data files, thanks to the help of several of you. I am now stuck with writing the final file with the following error (see also the full transcript below): Error in as.matrix.data.frame(x) : length of dimnames[2] not equal to array extent I do not know what it means and could not find how to get around that in the manual nor
2011 Apr 05
2
Help to check data before putting it in a database
The example scene: I have a database with stats about each goal made by my soccer team. This database (a data frame in R) is organized in lines (goals) with a set of columns containing data about these goals (player name, tactic position, etc). For now, this database will be called "data.frame1". What I need is to feed this "data.frame1" with new information about my team
2007 Aug 14
2
Question about unicode characters in tcltk
hello list, Can someone help me figure out why the following code doesn't work? I'm trying to but both Greek letters and subscripts into a tcltk menu. The code creates all the mu's, and the 1 and 2 subscripts, but it won't create the 0. Is there a certain set of characters that R won't recognize the unicode for? Or am I input the \u2080 incorrectly? library(tcltk) m
2005 Aug 12
2
coercing created variables into a new data frame using na.omit()
Hi, I am an R newbie and one thing I am having trouble with binding variables that I have created within one data frame into a new data frame when using na.omit(). To illustrate this problem I will give the example I am working on and the approah I have been using:- data.frame1<-filepath.... attach(data.frame1) #create a new variable using a function new.variable<-rep(1,length(weight3))
2008 May 26
1
To draw observation [m, n] from 20 data frames named frame1, ... , frame20
Hi all, I have 20 data frames, named frame1, ... , frame20. Each data frame has the dimension 20x5. I need to build a function that calls out the observation in Row 1, Col 2 from all 20 data frames and places it in a vector of length 20. I have tried the following code: vect <- rep(0,20) for(i in 1:20){ vect[i] <- paste("frame",i,"[1,2]",sep="") } The
2010 Jan 20
1
Merge and join data
Hi, I'm looking to combine two data frames. Several of the columns are in common while the others need to be summed up. The apply functions and the merge functions don't seem to be working. I've included a basic example of what I'm trying to do below. Thanks! Sean data.frame1<-as.data.frame(matrix(c('winter','dredge','515',100,150),1,5))
1999 Mar 01
1
"xpdrows.data.frame" (PR#131)
This is a follow-up to bug sent to days ago, which bounced from r-devel because the example was to large. Now example is smaller, and behaviour is as belo, EXEPT that r-windows not any more bombs, so main problem is "xpdrows.data.frame"??? By the way, how to debug this example under windows? debug() doesnt accept the functions used (.Primitive), and R wont run under gdb --- may have
2012 Jan 14
3
add column with values found in another data frame
I am positive this problem has a very simple solution, but I have been unable to find it, so I am asking for your help. I need to know how to look something up in one data frame and add it as a column in another. If I have a data frame that looks like this: > frame1 ID score test age 1 Guy1 10 1 20 2 Guy1 13 2 20 3 Guy2 9 1 33 4 Guy2 11 2 33 and another frame that looks like this:
2003 Jun 08
1
Need help on data frame
Dear Sir/Madam, I am new in R.I have data corresponding to every day. Problem is that there are some gap i.e. observation couldn't be done on some particular day. I want to place this data frame like exact data frame (every year it will change, Feb 28 or feb29) Maybe I need to make one coulmn of date (for each year, say this dataframe 'frame1'), then I need to place data set on
2013 Feb 13
3
match in dependence of 2 columns
Hello, i want to match a column of one data.frame to another, my problem is, that i only want to match the data, if 2 columns are equal. i have a example: data.frame1 cu.nr. name value A 1 Evo 100 B 1 Mer 80 C 2 Ford
2006 Oct 16
3
lda
I'm trying to do a linear discriminant analysis on a dataset of three classes ("Affinities"), using the MASS library: > data.frame2 <- na.omit(data.frame1) > > data.ld = lda(AFFINITY ~ ., data.frame2, prior = c(1,1,1)/3) Error in var(x - group.means[g, ]) : missing observations in cov/cor What does this error message mean and how can I get rid of it? Thanks! Pieter
2011 Apr 26
2
grid stringHeight
Dear all, I'm puzzled by the behavior of stringHeight in the grid package. Consider the following test, library(grid) test <- function(lab="dog", ...){ g1 <- textGrob(lab) g2 <- rectGrob(height=grobHeight(g1), width=grobWidth(g1)) gg <- gTree(children=gList(g1,g2), ...) print(c("height:", convertUnit(stringHeight(lab), "mm",
2005 Oct 03
2
grob questions
If I run the following example from: http://www.stat.auckland.ac.nz/~paul/grid/doc/grobs.pdf > grid.newpage() > pushViewport(viewport(w = 0.5, h = 0.5)) > myplot <- gTree(name = "myplot", children = gList(rectGrob(name = "box", + gp = gpar(col = "grey")), xaxisGrob(name = "xaxis"))) > grid.draw(myplot) >
2010 Oct 01
2
strange interaction between rasterImage and Grid graphics
Dear all, This may be specific to Mac, I haven't had a chance to test another platform. Consider this, plot(1,1,t="n") rasterImage(matrix(1),1,1,1,1) library(grid) grid.rect(gp=gpar(fill="grey")) The grid.rect covers the full device window as expected. However, when I resize the window ever so slightly (interactive device) the rectGrob is suddenly clipped to the previous
2009 Jan 19
1
Floating point excepting when cbind()ing a matrix of grobs (or environments) with a 0-column matrix
library(grid) e <- rectGrob() # OR: # e <- environment() a <- matrix(list(e), ncol = 1, nrow = 2) b <- matrix(ncol = 0, nrow = 2) cbind(a, b) cbind(a, b) This reliably crashes R for me. I realise this is a rather esoteric error condition, but it crops up for me when creating matrices of grobs to be turned into a ggplot2 plot. Hadley -- http://had.co.nz/
2005 Oct 03
1
Grid: constructing a gTree with grobs that use named viewports from a vpTree
I'm trying to create a layout with named viewports that I can use for other functions. I create the viewport tree that I want, and a list of grobs with the viewports describing where they should go. library(grid) vp <- vpTree( viewport(layout=grid.layout(2,2), name="layout"), children=vpList( viewport(layout.pos.col = 1, layout.pos.row=1, name="tl"),
2009 Sep 20
1
packGrob and dynamic resizing
Dear all, I'm trying to follow an old document to use Grid frames, Creating Tables of Text Using grid Paul Murrell July 9, 2003 As a minimal example, I wrote this, gf <- grid.frame(layout = grid.layout(1, 1), draw = TRUE) label1 <- textGrob("test", x = 0, just = "left", name="test") gf=placeGrob(gf, rectGrob(), row = 1, col = 1) gf=packGrob(gf,
2009 May 21
1
size of point symbols
Dear list, This might be a topic for r-devel but i may be missing something obvious. I don't understand the rationale in the absolute sizes of the point symbols, and I couldn't find it documented. The example below uses Grid to check the size of the symbols against a square of 10mm x 10mm. > checkOneSymbol <- function(pch=0){ > gTree(children=gList( >