Hi,
Try this,
library(gridExtra)
example(grid.table)
or addtable2plot() in plotrix, or textplot() in gplots, or Hmisc using
latex, or Sweave, ...
HTH,
baptiste
PS: please read the posting guide
On 20 August 2011 05:14, Ed Heaton heat...@comcast.net wrote:
Hi, friends.
I keep coming to
Hi,
I think it's a side effect of lazy evaluation, where you should
probably use the ?force like a jedi,
lapply(1:5,function(k){force(k) ; function(){k}})[[2]]()
HTH,
baptiste
On 18 March 2011 07:01, jamie.f.olson inspired2apa...@gmail.com wrote:
So, I've been confused by this for a while.
Hi,
because each colour is defined on non-consecutive points, you'll
probably need to cut the intervals to define segments around each
point. One approach might be the following,
d = transform(data, start = date - c(0, diff(date)/2), end = date +
c(0, diff(date)/2) )
d$start.y = approx(d$date,
I find it quite neat with plyr,
library(plyr)
ddply(d, .(group), transform, max=max(val))
HTH,
baptiste
On 22 March 2011 12:09, William Dunlap wdun...@tibco.com wrote:
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of ivo welch
Hi,
The following read might be useful,
http://romainfrancois.blog.free.fr/index.php?post/2010/04/03/embed-images-in-Rd-documents
baptiste
On 29 March 2011 22:33, Etienne Stockhausen einohr2...@web.de wrote:
Hey R-user,
I’ve searched the archives about the following questions and didn’t
Hi,
If you want grid graphics:
For data.frames and matrices, gridExtra has a grid.table() function.
For strings (paragraph), Rgraphics has a function too, whose name i
forget. It could be possible to combine the two and define a method to
display lists as well.
HTH,
baptiste
On 30 March
Hi,
For most purposes, I find that R graphics get 95% of the work done
towards final publication. A couple of personal comments,
- lattice, ggplot2, RColorBrewer, evidently. ggplot2, in particular,
makes really good aesthetic decisions by default.
- whilst R devices are really good, I find
Hi,
Also, try this and rm() it immediately,
`+` - function(x, y) x - y
1+1
rm(`+`)
1+1
baptiste
On 31 March 2011 05:04, Chuanlong Du dcl...@iastate.edu wrote:
Hello, everyone!
Does anyone know how make some symbols have special means in R? For example,
we know that + in R means the sum of
Hi,
You may want to read about ?viewport in the grid package. They allow
you to position graphical elements wherever you want on a page, such
as lattice plots and text (grid.text). For a high-level interface, you
could try the following,
library(gridExtra)
library(lattice)
p1 = xyplot(1~1)
p2
the question, whatever it was.
Best,
baptiste
On 11 April 2011 09:54, Mark Leeds marklee...@gmail.com wrote:
hi baptiste: thanks for that but how do I get mpg ? I got an error that R
couldn't find it. thanks again.
On Sat, Apr 9, 2011 at 9:45 PM, baptiste auguie
baptiste.aug...@googlemail.com
Hi,
You could try,
library(plyr)
ddply(data, .(name), transform, mean=mean(sale))
ddply(data, .(name), summarize, mean=mean(sale))
HTH,
baptiste
On 12 April 2011 15:46, Geoffrey Smith g...@asu.edu wrote:
Hello, I would like to take the mean of a column from a data frame and then
bind the
Hi,
You probably need ?get, though you might want to read this first,
library(fortunes)
fortune(236)
HtH,
baptiste
On 13 April 2011 13:04, Sparks, John James jspa...@uic.edu wrote:
Dear R Helpers,
I am trying to change the name of an object using the assign function.
When I use paste on
Hi,
ggplot2 automatically adjusts its axes when new data are added to
plots; however you wouldn't get an automatic legend if you constructed
plots that way.
HTH,
baptiste
On 13 April 2011 17:06, James Annan jdan...@jamstec.go.jp wrote:
Thanks for all the replies. Yes, I agree that calculating
Hi,
I may be wrong, but I have the impression that tikz (a LaTeX drawing
package) can handle spot colors (that's what Google seemed to tell me
[*]). If this is the case you could output R graphics using the
tikzDevice package, post-process the output (readable, plain text
file), and eventually
Hi,
Have you tried ?c.trellis in the latticeExtra package?
HTH,
baptiste
On 13 April 2011 23:36, Francesco Nutini nutini.france...@gmail.com wrote:
Dear R-users,
I have to plot two xyplot, and I wish to enclose this two graphs with just
one headline, the same x scale, the same grid etc.
On 14 April 2011 07:51, Hadley Wickham had...@rice.edu wrote:
Am I missing something obvious on how to draw multi-line plots in base
graphics?
In ggplot2, I can do:
It appears you've been infected with what I like to call the Dijkstra
syndrome [*], quoting
The tools we use have a profound
Dear list,
I wish to modify programmatically only a few factor levels, according
to a named list. I came up with this function,
modify.levels - function(f, modify=list()){
## levels that will not be changed
names.old.levels - setdiff(levels(f), unlist(modify))
## as a named list
Hi,
Through pgfSweave you can use the tikz device, which is the one that
can interpret Latex code (package tikzDevice). I would start with a
minimal self-contained plot with this function. see ?tikz for
examples.
HTH,
baptiste
On 15 April 2011 20:03, Michael McAssey mpmcas...@gmail.com
Hi,
Try this,
snip = function(x, n=1) {
rand = sample(1:3, 1)
print(paste(using algorithm #, rand))
switch(rand,
'1' = head(x, length(x) - n),
'2' = x[ seq(1, length(x) - n) ],
'3' = x[ - seq(length(x), by=-1, length=n) ])
}
snip(1:5)
HTH, but please
Hi,
Does this help?
library(gridExtra)
my.title = function(expressions) {
grid.table(expressions, parse=TRUE,
theme=theme.list(gpar.corefill = gpar(fill = NA, col = NA),
core.just = left))
}
e = expression(alpha,text, italic(italic),
hat(beta),
you'll need a more
recent version of gridExtra than the one on CRAN. You can get it here:
http://code.google.com/p/gridextra/
baptiste
Cheers,
Marius
On 2011-04-19, at 24:03 , baptiste auguie wrote:
Hi,
Does this help?
library(gridExtra)
my.title = function(expressions) {
grid.table
=gpar(fill=NA, col=NA), # make bg transparent
core.just=left) # justification of labels
)
}
xyplot(1~1, panel=function(...) info(0.1, 0.5) )
On 2011-04-19, at 21:39 , David Winsemius wrote:
On Apr 19, 2011, at 3:26 PM, baptiste auguie wrote:
I'm hoping
Hi,
You may want to wait advice from someone who actually understands (the
labyrinth that is) lattice's help for splom, but the following might
be a start. I didn't understand what values you actually wanted
displayed in the lower triangle panels, so I made up some random ones
in a 3x3 matrix of
)), ncol=2, byrow=T)
grid.table(d, parse=T,theme=theme.list(
gpar.corefill=gpar(fill=NA, col=NA),
core.just=left, padding.h = unit(0, mm) ))
HTH,
baptiste
On 2011-04-20, at 01:33 , baptiste auguie wrote:
Hi,
You may want to wait advice from someone who
On 20 April 2011 21:16, Marius Hofert m_hof...@web.de wrote:
Dear expeRts,
is there a way to get the entries in each panel correctly aligned according
to the
equality signs?
Here is the wish-list:
(1) the equality signs in each panel should be vertically aligned
You can put the equal
)))
arr[i,j,] - c(alpha, eq, numbers[1],
italic(bbb), eq, numbers[2],
gamma, eq, numbers[3])
}
}
## plot
splom2(x, arr, nr=3)
On 2011-04-20, at 11:56 , baptiste auguie wrote:
On 20 April 2011 21:16, Marius Hofert m_hof...@web.de wrote
])
}
}
## plot
splom2(x, arr, nr=3)
On 2011-04-20, at 22:38 , baptiste auguie wrote:
Try this,
align.digits = function(l)
{
sp - strsplit(as.character(l), \\.)
chars - sapply(sp, function(x) nchar(x)[1])
n = max(chars) - chars
l0 = sapply(n, function(x) paste(rep(0, x), collapse=))
labels
Unfortunately, it seems that vcd doesn't return grobs but draws
directly to the device, which prevents a concise solution. You could
try the following,
library(gridExtra)
library(vcd)
data(Titanic)
p = grid.grabExpr(mosaic(Titanic))
grid.arrange(p, p, p, ncol=2)
Or, more versatile but also more
Hi,
The package maintainer is aware of this feature request. In the
meantime, I've used Currying,
require(cubature)
f - function(x, a) cos(2*pi*x*a) # a simple test function
adaptIntegrate(roxygen::Curry(f, a=0.2), lower=0, upper=2)
HTH,
baptiste
On 4 May 2011 05:57, Ravi Varadhan
Hi,
Try this,
cat(format(The TITLE, width=80, justify=centre))
HTH,
baptiste
On 5 May 2011 19:28, Dan Abner dan.abne...@gmail.com wrote:
Hello everyone,
I have a few questions about the print() fn:
1) I have the following code that does not center the character string:
print(The
Hi,
Below are a couple of options using a standard dataset,
str(iris)
## using base graphics
d - split(iris, iris$Species)
str(d) # list of 3 data.frames
par(mfrow=n2mfrow(length(d))) # split the device in 3 plotting regions
b.quiet - lapply(names(d), function(x) { # loop over the list names
Hi,
Are you after this?
last_plot() + opts(aspect.ratio=1)
Also, see https://github.com/hadley/ggplot2/wiki/Themes for some
settings re: plot margins.
HTH,
baptiste
On 1 September 2011 05:18, Alaios ala...@yahoo.com wrote:
Dear all,
I am using ggplot with geom_tile to print as an image a
Hi,
Try this,
d - data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30))
d$z = (d$x - 15)^2 + (d$y - 15)^2
library(spatstat)
library(maptools)
W - ripras(df, shape=rectangle)
W - owin(c(0, 30), c(0, 30))
X - as.ppp(d, W=W)
Y - dirichlet(X)
Z - as(Y, SpatialPolygons)
plot(Z,
Hi,
if your logo is in vector format you should probably try the grImport
package; see its vignette for examples, also below,
library(grImport)
## http://creativecommons.org/about/downloads/
PostScriptTrace(cc.logo.eps)
cc - readPicture(cc.logo.eps.xml)
logo - pictureGrob(cc[16:18], x=unit(1,
Have you tried asciidoc (ascii package)? It seems like a good fit for
your needs.
baptiste
On 23 September 2011 11:09, Tal Galili tal.gal...@gmail.com wrote:
Hello dear R help members,
I have found several references on how to do this, my question is if anyone
is actually using them - and
More concisely,
ddply(Orange, .(Tree), transform, scaled = scale(age))
HTH,
baptiste
On 4 October 2011 11:24, john.morrongie...@csiro.au wrote:
That works a treat Thierry, thanks! I wasn't aware of the plyr package but I
like what it does- I'll put it to use work in the future.
Regards
Hi,
Using ddply,
ddply(df, .(ID), mutate, nrows=length(rel.head), test = nrows==2
all(rel.head %in% c(1,3)))
HTH,
baptiste
On 5 October 2011 06:02, Dennis Murphy djmu...@gmail.com wrote:
Hi:
Here's another way to do it with the plyr package, also not terribly
elegant. It assumes that
Hi,
there are a couple of themes proposed in the wiki, one being white on black,
https://github.com/hadley/ggplot2/wiki/Themes
HTH,
baptiste
On 6 October 2011 04:05, Eugene Kanshin kanshin...@gmail.com wrote:
Hello,
I'm trying to produce some plots in ggplot2 to use them on
the dark-blue
On 6 October 2011 09:23, Dennis Murphy djmu...@gmail.com wrote:
Hi:
One option is the gridExtra package - run the example associated with
the tableGrob() function. Another is the addtable2plot() function in
the plotrix package. I'm pretty sure there's at least one other
package that can do
package plyr makes it easier,
plyr::each(function.list)(pi)
HTH,
baptiste
On 15 October 2011 11:55, Richard M. Heiberger r...@temple.edu wrote:
function.list=c(sin, cos, function(x) tan(x))
for (f in function.list) print(f(pi))
[1] 1.224606e-16
[1] -1
[1] -1.224606e-16
On Fri, Oct 14,
Hi,
You could also pad the text labels with phantom 0s,
ghostrighter - function(x, ...){
n - sapply(x, nchar)
nmax - max(n)
padaone - function(ii){
si - paste(rep(0, length= nmax - n[ii]), collapse=)
as.expression(bquote(phantom(.(si)) * .(x[ii]) ))
}
sapply(seq_along(x),
Hi,
I believe you want
eval(parse(text=pi/2))
a word of warning exemplified in
eval(parse(text=library(fortunes) ; fortune(106)))
HTH,
baptiste
On 19 October 2011 19:30, Erin Hodgess erinm.hodg...@gmail.com wrote:
Dear R People:
Suppose I have the following:
pi/2
and I would like
Hi,
the grImport package provides some tools for this.
HTH,
b.
On 19 February 2012 16:06, Nick Matzke mat...@berkeley.edu wrote:
Hi,
Is there a way to parse a postscript (*.ps) file with R (or perhaps with
some other command-line utility)?
E.g., I have a map in postscript format with
Hi,
If you're going to use different text sizes and convert between units,
it might be easier to do the calculations with grid.
par(mar=c(1,1,1,5))
plot(1:10)
labels = c(1, 2, 10, 123, 3.141592653589, 1.2, 2)
sizes = c(1, 1, 2, 1, 0.4, 1, 3) # cex of individual labels
## pure base graphics
Hi,
Try the cubature package, and maybe play with the tolerance.
HTH,
b.
On 13 March 2012 18:39, Niroshan wnnpe...@ucalgary.ca wrote:
Dear R Members,
I want to know a fast R function to do multidimensional integration. I used
the function 'cuhre' in R2cuba library. But it takes painful
Hi,
Try this,
replicate(sample(10,1), dev.new())
graphics.off()
HTH,
baptiste
On 15 March 2012 20:36, Alaios ala...@yahoo.com wrote:
Dear all,
I would like at the beginning of my code to turn off all the remaining open
devices.
How can I do that by using dev.off()?
I would like to
Hi,
I would do the following,
library(ggplot2)
require(reshape)
TestData - structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3), line = c(1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2,
1, 1, 1, 1, 1), instance = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2), drug =
Hi,
On 1 April 2012 03:41, Paul Miller pjmiller...@yahoo.com wrote:
Hello Baptiste,
What you've done is very interesting. Went through and tried to understand
all the steps. Reminded me of studying languages in years gone by. Always
found it easier to read and understand a sentence than to
Dear list,
I am trying to find a fast solution to read moderately large (1 -- 10
million entries) text files containing only tab-delimited numeric
values. My test file is the following,
nr - 1000
nc - 5000
m - matrix(round(rnorm(nr*nc),3),nr=nr)
write.table(m, file = a.txt, append=FALSE,
might be
causing this?
Thanks,
baptiste
On 2 April 2012 11:04, Duncan Murdoch murdoch.dun...@gmail.com wrote:
On 12-04-01 2:58 AM, baptiste auguie wrote:
Dear list,
I am trying to find a fast solution to read moderately large (1 -- 10
million entries) text files containing only tab-delimited
Hi,
Embarrassingly enough, it was quite straight-forward in the first
versions of grid.table(). You might want to try with version r11 for
example,
source(http://gridextra.googlecode.com/svn-history/r11/trunk/R/tableGrob.r;)
library(grid)
tc = textConnection(
carat VeryLongWordIndeed
Hi,
The easiest way to get the wide curly braces in your plot might be the
tikzDevice package. In its vignette you'll find an example of placing
an arbitrary tikz element in a plot, featuring a curly bracket. Sadly,
the internal coordinate system used by ggplot2 might make the
positioning a
Hi,
Try the package orthopolynom on CRAN.
HTH,
baptiste
On 8 December 2010 12:51, Alaios ala...@yahoo.com wrote:
Hello everyone,
I would like to find out if there are already implemented function for
legendre
polynomials. I tried google but returns nothing. How do you suggest me to
Hi,
Try the following,
plot(1:10,rnorm(10),t=o)
## fill the points in white
plot(1:10,rnorm(10),t=o,pch=21,bg=white)
You could also try this with Grid graphics,
library(gridExtra)
# like type=o
grid.barbed(space=0)
# like type=b
grid.barbed(space=1)
# like the example above, but without
Hi,
The fastest way seems to be,
all(x[1] == x)
HTH,
baptiste
On 16 December 2010 15:17, Jannis bt_jan...@yahoo.de wrote:
Dear list,
this might be an easy one, but I could figure out a solution (or how to
google the right term).
Is there any way to test whether all elements of a
Hi,
this seems to work,
plot.new()
legend(topleft, legend=as.expression(c(bquote(.(txt) ==
.(obv)*degree), Von Mises distribution)))
HTH,
baptiste
On 28 December 2010 20:17, Tyler Dean Rudolph
tylerdeanrudo...@gmail.com wrote:
legend(topleft, legend=c(bquote(.(txt) == .(obv)*degree), Von
See aes_string(), perhaps.
baptiste
On 1 January 2011 18:56, Mark Sharp msh...@sfbr.org wrote:
I am wanting to change arguments to a function dynamically. For example, in
making a call to qplot, I want to dynamically define all of the arguments so
that I can create the plot dependent on
Hi,
embed() seemed well-suited, but I couldn't figure out an elegant way to use it
embed(c(A,A), 4)[1:4, 4:1]
HTH,
baptiste
On 6 January 2011 22:34, ADias diasan...@gmail.com wrote:
Hi
Suppose we have an object with strings:
A-c(a,b,c,d)
Now I do:
B-matrix(A,4,4, byrow=F)
and I
Hi,
Try this,
mode(m) - integer
HTH,
baptiste
On 10 January 2011 10:17, emj83 stp08...@shef.ac.uk wrote:
Hi,
I would like to turn my TRUE/FALSE matrix into a 1/0 matrix (i.e. True=1 and
False=0)
[,1] [,2] [,3]
[1,] TRUE FALSE FALSE
[2,] TRUE TRUE FALSE
[3,] TRUE TRUE
Hi,
Try this,
m = melt(dat, id=Date)
head(m)
qplot(Date, value, data=m, colour=variable, geom=line)
ggplot(m) + facet_grid(variable~., scales=free_y) +
geom_path(aes(Date, value))
HTH,
baptiste
On 10 January 2011 14:12, Santosh Srinivas santosh.srini...@gmail.com wrote:
Hello R-Group,
of layers,
qplot(Date, Close, data=dat,geom=line) +
geom_line(aes(Date, vol), colour=red)
HTH,
baptiste
-Original Message-
From: baptiste auguie [mailto:baptiste.aug...@googlemail.com]
Sent: 10 January 2011 18:59
To: Santosh Srinivas
Cc: r-help@r-project.org
Subject: Re: [R] Basic
Hi,
Perhaps the easiest way is with grid.raster,
library(grid)
pdf(colorstrip.pdf, height=1, width=10)
grid.raster( t(myCols), width=unit(1,npc), height=unit(1,npc),
interpolate=FALSE)
dev.off()
HTH,
baptiste
On 20 October 2011 03:32, Brian Smith bsmith030...@gmail.com wrote:
Hi,
I was
Try this,
library(grid)
grid.newpage()
grid.text(text)
HTH,
baptiste
On 22 October 2011 13:26, rkevinbur...@charter.net wrote:
I noticed that the text() command adds text to a plot. Is there a way to
either make the plot blank or add text to a blank sheet. I would like
to plot a page that
Hi,
Try the dichromat package (also dichromat_pal in the scales package).
HTH,
baptiste
On 3 November 2011 10:26, Max Kuhn mxk...@gmail.com wrote:
Everyone,
I'm working with scatter plots with different colored symbols (via
lattice). I'm currently using these colors for points and lines:
Hi,
Try specifying explicit break points together with their corresponding
colors using at and col.regions,
levelplot(m, at= unique(c(seq(-2, 0, length=100), seq(0, 10,
length=100))), col.regions = colorRampPalette(c(blue, white,
red))(1e3))
HTH,
baptiste
On 7 November 2011 16:08, Lanna Jin
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like to perform a numerical integration in one dimension,
I = int_a^b f(x) dx
where the integrand f: x in IR - f(x) in IR^p is vector-valued.
integrate() only allows scalar integrands,
Dear Ravi,
Thank you for your answer.
The integrand I proposed was a dummy example for demonstration
purposes. I experienced a similar slowdown in a real problem, where
knowing in advance the shape of the integrand would not be so easy.
Your advice is sound; I would have to study the underlying
Dear Hans,
[see inline below]
On 11 November 2011 22:44, Hans W Borchers hwborch...@googlemail.com wrote:
baptiste auguie baptiste.auguie at googlemail.com writes:
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like
Hi,
Try grepl instead of sub,
mena[grepl(m5., mena)]
HTH,
baptiste
On 14 November 2011 21:45, Petr PIKAL petr.pi...@precheza.cz wrote:
Dear all
I am again (as usual) lost in regular expression use for selection. Here
are my data:
dput(mena)
Hi,
Please don't cross post.
It seems that ggplotGrob has been replaced by new functions. You can
define it as
ggplotGrob - function(x) ggplot2:::gtable_gTree(ggplot2:::ggplot_gtable(x))
and it seems to work as before with grid.arrange().
HTH,
baptiste
On Wed, Nov 16, 2011 at 3:26 AM,
Hi,
Two possible routes I can suggest:
1- export the plot in svg format, which supports natively the use of
filling patterns, e.g.
http://www.w3.org/TR/SVG/images/pservers/pattern01.svg
It's possible that the gridSVG package could help you automate the
process of grid.garnish()-ing the grobs;
Hi,
package planar is concerned with the full electromagnetic problem at
planar interfaces, which is not very useful for raytracing. The cda
package includes a small demo interfacing either rgl or povray (via
system call) to visualize 3D clusters of metallic particles. A more
general interface to
Hi,
On 22 December 2011 09:16, rachaelohde cox.rach...@gmail.com wrote:
Hello,
I am trying to plot means and standard errors conditioned by a factor, using
qplot. I am successful at getting the bar graph I want with a error bar,
however I have tried many things and cannot get the bars to
ggExtra was not compatible with the recent changes in ggplot2 and had
become partially redundant, so I removed it.
grid.arrange and arrangeGrob in gridExtra won't help with the
alignment of axes. align.plots, which I can always send you offlist if
you want, extracted the size of axes and legends
You could draw a grid with grid, using grid.grill,
library(grid)
pdf(grid.pdf, width=21/2.54,height=29.7/2.54)
grid.grill(h = unit(seq(0, 297, by=1), mm),
v = unit(seq(0, 210, by=1), mm), gp=gpar(col=grey,lwd=0.1))
grid.grill(h = unit(seq(0, 297, by=5), mm),
v = unit(seq(0,
One reason might be that you can easily fool the user into running
unexpected/unreadable commands. Guess what this does:
cmd - paste(c(letters[c(19L, 25L, 19L, 20L, 5L, 13L)], (' ,
letters[c(19L, 21L, 4L, 15L)], , letters[c(4L,
5L, 19L, 20L, 18L, 15L, 25L)], , letters[c(1L, 12L, 12L)], ')),
The scales package?
gradient_n_pal(c(red,white,blue), c(0,0.5,1)) (seq(0,1,length=100))
HTH,
baptiste
On 26 January 2012 10:36, Jeffrey Joh johjeff...@hotmail.com wrote:
The gray (level) function returns different shades of gray, where level is a
vector of numbers ranging from 0 to 1. 0
Hi,
which(x 15)
omits the NA (treated as false).
HTH,
b.
On 29 January 2012 09:36, Federico Calboli f.calb...@imperial.ac.uk wrote:
Dear All,
just a quick example:
x = 1:25
x[12] = NA
x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
y = x[x10]
y
[1] 1
Try this,
plot(1:10)
img - grid::grid.cap()
# grid.raster(img)
stream - col2rgb(img)
write.table(stream, file=dam.txt, row.names = FALSE,
col.names = FALSE)
(you'll have to restore the dimensions of the matrix once you've read
the rgb values for each pixel)
HTH,
baptiste
On 30
Hi,
If you don't mind having NAs for missing values, try the following,
mylist = list(1:3, 4:7)
library(plyr)
write.csv(do.call(rbind.fill.matrix, lapply(mylist, matrix, nrow=1)), file=)
HTH,
b.
On 6 February 2012 15:01, Michael comtech@gmail.com wrote:
Hi all,
I have a list of vector
Hi,
If you read French, you might find the following discussion interesting,
http://www.forum.math.ulg.ac.be/viewthread.html?id=45765
It contains some good suggestions to project an ellipsoid onto a
plane, which as I understand might be related to your question.
HTH,
b.
On 8 February 2012
On 9 February 2012 13:02, David Winsemius dwinsem...@comcast.net wrote:
On Feb 8, 2012, at 6:33 PM, Tom Roche wrote:
Peter Langfelder Thu Feb 9 00:01:31 CET 2012
I'm exploring using a version control system
+1! welcome to the new millenium :-)
to keep better track of changes to the [R]
Once upon a time r-forge had the option to sync from an external svn
repository, e.g. hosted on googlecode. I haven't seen it available for
some time, sadly. I'm sure many users would appreciate if this feature
came back with the new interface. Not sure if it could work with git
as well, though.
A minimum code to plot a coloured matrix with text labels could be the
following:
library(grid)
library(scales)
library(RColorBrewer)
diverging_palette - function(d = NULL, centered = FALSE, midpoint = 0,
colors = brewer.pal(7,PRGn)){
half - length(colors)/2
The default units of polygonGrob are npc, I think you want native instead.
Try the following,
library(grid)
d = data.frame(x=rnorm(100, 10), y=rnorm(100, -100))
v = dataViewport(xData=d$x, yData=d$y)
grid.points(d$x,d$y, default.units=native, vp=v)
HTH,
b.
On 17 February 2012 02:47,
Hi,
On 8 May 2011 21:18, Berwin A Turlach berwin.turl...@gmail.com wrote:
G'day Dan,
On Sun, 8 May 2011 05:06:27 -0400
Dan Abner dan.abne...@gmail.com wrote:
Hello everyone,
I am attempting to use the %in% operator with the ! to produce a NOT
IN type of operation. Why does this not work?
I imagine mind_read() easy to implement with Robin Hankin's emulator
package -- under some weak assumptions about the user; mind_write(),
however, seems more involved and might require investing in new
hardware.
Best,
baptiste
On 21 May 2011 12:04, Rolf Turner rolf.tur...@xtra.co.nz wrote:
On
Hi,
There are probably much better ways, but try this
transform(dat, group = as.numeric(factor(paste(A,B,C, sep=
HTH,
baptiste
On 31 May 2011 09:47, Mendolia, Franco fmendo...@mcw.edu wrote:
Hello,
I would like to create a group variable that is based on the values of three
I propose a Pi Haiku (PIQ),
Pi is of certain value,
In statistics, invaluable, yet
Transcending numerics.
Best,
baptiste
On 1 June 2011 11:55, Ravi Varadhan rvarad...@jhmi.edu wrote:
Nice to know that the `pi' can be sliced in so many different ways!
There are exactly 3.154 x e08 seconds in
A, B, C should have the same number of rows.
mlist = replicate(3, matrix(rnorm(6), 2), simplify=FALSE)
names(mlist) = LETTERS[seq_along(mlist)]
with(mlist, cbind(A,B,C))
or,
do.call(cbind, mlist)
HTH,
baptiste
On 5 June 2011 11:14, Jim Silverton jim.silver...@gmail.com wrote:
How can I
Hi,
Try this
ggplot(df, aes(x,y)) + geom_tile(aes(fill=height), colour=white) +
scale_fill_gradientn(colours = c(red, gold, green)) +
geom_text(aes(lab=height))
HTH,
baptiste
On 14 June 2011 07:12, idris idris.r...@gmail.com wrote:
I have a dataframe df with columns x, y, and height. I want
Hi,
You can draw arrangeGrob in a rotated viewport,
library(gridExtra)
library(ggplot2)
ps = replicate(4, qplot(rnorm(10), rnorm(10)), simplify=F)
g = gTree(children=gList(do.call(arrangeGrob, ps)), vp=viewport(angle=90))
grid.draw(g)
though you get some warnings about clipping for some reason.
Hi,
As far as I know secondary y-axis and multiple pages are not possible
in ggplot2 (there are workarounds for the latter in the ggplot2 list
archives). For the subtitle, you could implement it with grid.text and
grid viewports,
library(gridExtra)
library(ggplot2)
grid.arrange( qplot(1,1), sub
Try this,
library(ggplot2)
d - data.frame(theta = runif(10, 0, 360), r = runif(10, 0, 3))
ggplot(d, aes(x=theta, y=r, size=r)) + coord_polar(start=0)+
geom_point() +
scale_x_continuous(breaks=seq(0, 360, by=30), expand=c(0,0), lim=c(0, 360))+
scale_area()
HTH,
baptiste
On 28 June 2011
you can open a device that has the exact dimensions of the table,
g = tableGrob(head(iris, 4))
png(test.png, width=convertWidth(grobWidth(g), in, value=TRUE),
height=convertHeight(grobHeight(g), in,
value=TRUE),units=in, res=150)
grid.draw(g)
dev.off()
Doing this with knitr might be
2012 09:43, Alexander Shenkin ashen...@ufl.edu wrote:
this works - thanks baptiste! i'm working in Sweave right now - perhaps
it will be tough in knitr as you mention.
On 5/25/2012 4:31 PM, baptiste auguie wrote:
you can open a device that has the exact dimensions of the table,
g = tableGrob
Hi,
Another option that you might want to try is the tikzDevice package;
tikz has functions to flip and rotate objects and could it from R with
tikzAnnotate / tikzAnnotateGrob. Of course these objects would not
really be grobs but tikz code, though for text the end result would
probably be the
Hi,
On 6 June 2012 08:58, Paul Murrell p.murr...@auckland.ac.nz wrote:
Hi
Here's one way to approach it ...
ggplot(data.frame(x=1:10, y=1:10)) +
geom_polygon(aes(x=xx, y=yy), fill=grey70,
data=data.frame(xx=c(0, 0, 4, 4), yy=c(0, 11, 11, 0))) +
geom_point(aes(x=x, y=y))
Try this,
rotate = function(x) paste(strsplit(x,)[[1]],collapse=\n)
t - this is a text
plot.new()
text(1/2,1/2,t)
par(lheight=0.8)
text(1/2,1/2,rotate(t))
HTH,
b.
On 13 June 2012 01:49, Stuart Rosen s.ro...@ucl.ac.uk wrote:
For labelling a plot, I am trying to rotate a character string
Have a look at this:
http://stackoverflow.com/questions/7734535/control-font-thickness-without-changing-font-size
and
http://stackoverflow.com/questions/10686054/outlined-text-with-ggplot2
which refers to a base graphics version.
HTH,
b.
On 20 June 2012 07:58, MacQueen, Don
601 - 700 of 724 matches
Mail list logo