orresponding elements of
"percent"
and "min" defined above. Admittedly I have never felt very
comfortable with
factors. Could you please give me some advice?
Thank you very much.
baptiste auguie-2 wrote:
Hi,
I think you could get a cleaner solution using ?cut to spl
colorspace package.
>
> -thomas
>
>
> On Sun, 15 Mar 2009, baptiste auguie wrote:
>
>> I've put together a rough R port of that C code [*] in a package on
>> r-forge:
>>
>> http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/spectral/
On 19 Mar 2009, at 07:22, Dieter Menne wrote:
Gundala Viswanath gmail.com> writes:
I have the following code that try to plot
simple sinus curve into 2x2 grid in 1 page.
But this code of mine create 4 plots in 1 page
each. What's wrong with my approach?
...
library(lattice)
library(grid)
Hi,
you could have a look at the doBy package which makes these operations
easier. Hadley's plyr package is also another option.
baptiste
On 20 Mar 2009, at 01:01, Altaweel, Mark R. wrote:
Hi,
I am trying to perform various functions on a list with a number of
elements. For example. I
Hi,
it would help if you provided a minimal example.
Here is one approach I often use with the plotting package ggplot2,
parameters <- expand.grid(m=c(0, 1), s=seq(0.1, 1,length=10))
x <- seq(-5, 5, length=300)
foo <- function(m, s){
data.frame(x=x, y=dnorm(x, m, s), m=factor(m), s=fa
conditional. I think the result
is it just overwrites the previous answer so my final results is not
as large as I would expect.
Thanks again in advance.
Mark
-Original Message-
From: baptiste auguie [mailto:ba...@exeter.ac.uk]
Sent: Fri 3/20/2009 4:32 AM
To: Altaweel, Mark R.
Cc: r-help
Dear all,
I wrote a wrapper to a FORTRAN program using R. The main program uses
a text file (~200 lines) as an input describing the simulation to be
run. I typically generate the file once with the right parameters
using a combination of file(), paste(), cat(). This is fine, and it
works
is indeed much more natural to create and manipulate all the
strings in R and write the new file every time in a single step.
Thanks,
baptiste
On 27 Oct 2008, at 10:47, Duncan Murdoch wrote:
baptiste auguie wrote:
Dear all,
I wrote a wrapper to a FORTRAN program using R. The main prog
Hi,
You could use the grid package to place treillis objects in any custom
layout you want, for example
(inspired by Paul Murrell's R graphics book < http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html
> fig 5.22),
library(grid)
library(lattice)
df <- data.frame(x=rnorm(100),
Hi,
I believe you could use plot.window(xlim,ylim,...), followed by par().
In any case, the code of plot.default should inspire you (note that
it's calling plot.new(), for instance).
Baptiste
On 30 Oct 2008, at 09:32, Johannes Graumann wrote:
Hello,
Is it possible to get all "par" conte
Hi,
I believe you can apply the same procedure as described in Paul
Murrell's "R graphics" book for arranging lattice plots.
library(grid)
library(ggplot2)
?grid.layout
df <- data.frame(x=rnorm(100), y=rnorm(100))
df2 <- data.frame(x <- rnorm(100), y=runif(x))
p <- qplot(x,y, data=df)
p2 <
perhaps you could also look into ggplot2 or lattice package to display
several plots on the same page.
They take care of important but annoying details such as scaling,
layout, limits, legend, ... Admittedly, there is a learning curve when
you're used to base graphics, but in the long term it
perhaps something like,
func <- function(f, ...) {
do.call(f, ...)
}
func(rnorm, list(n=3, mean=2, sd=3))
baptiste
On 7 Nov 2008, at 10:21, [EMAIL PROTECTED] wrote:
How can I apply function f, that I get as an argument as in
func <- function(f, ...) {
.
.
.
}
to a list of arguments list
Dear all,
I'm writing a code that requires Bessel functions with complex argument.
Searching the list, I found the continuation of a thread I initiated a few
months ago:
http://tolstoy.newcastle.edu.au/R/e4/devel/08/03/0746.html
As I understand, the most promising option would be to use the fort
you may want to look into Hadley's new package plyr for this kind of
operation.
baptiste
On 12 Nov 2008, at 17:51, Stavros Macrakis wrote:
By-the-way^2: is there some Xapply function that maps a function over
all the elements of a structure (vector, matrix, list, ...) and
preserves the origi
Hi,
Your idea reminds me of an example in the documentation of the brew package,
featuring the generation of a template. You might want to check it out.
baptiste
On Wed, Nov 12, 2008 at 2:01 PM, Kem Phillips <[EMAIL PROTECTED]>wrote:
> Dirk,
>
>
>
> I came upon your message below in searching f
Hi,
I think the following code should do what you want,
xyplot(yvar~year|week,data=df,layout = c(4, 5),
type='p',
groups = temp ,
panel = function(x, y, ...) {
panel.superpose(x, y,
Dear list,
My favorite output format is usually pdf. I can include the graphics
in pdflatex documents and benefit from the scalable nature of vector
graphic formats.
However, I recently had to generate high-res 2D levelplot graphics as
in the example below,
N <- 100
# N <- 1000 # slow to
Thanks for your comment. I would typically follow this approach too,
but I'm wondering whether one could find a more sophisticated
solution. Ideally, I'd like to be able to select the text that is
annotating the figure. There are very few cases where I can see a real
need for raster text, t
Hi,
you are feeding lapply "i" as an optional argument, which is passed to
fn() and causes an error. Just use lapply(1:4, fn), or better yet,
sapply,
> fn <- function(i) return(i^2)
> sapply(1:4, fn)
[1] 1 4 9 16
Hope this helps,
baptiste
On 20 Nov 2008, at 16:31, megh wrote:
I ha
Dear list,
I'm trying to get two lattice plots aligned on a page. They should
share a common x axis, hence the need for perfect alignment, but the
data is taken from unrelated, separate sources (it is therefore
inappropriate to combine them and use facetting to get an automatic
layout: t
Hi,
If you wish to connect each point to the next with a different
linetype, I think your best bet is to use segments()
x <- stats::runif(12); y <- stats::rnorm(12)
i <- order(x,y); x <- x[i]; y <- y[i]
plot(x, y)
s <- seq(length(x)-1)
segments(x[s], y[s], x[s+1], y[s+1], lty=1:10)
If, how
Just a thought on this topic, I found Harminv quite powerful for this
sort of task. I wonder whether it could be wrapped into a R package
(it's GPL).
http://ab-initio.mit.edu/wiki/index.php/Harminv
On 20 Nov 2008, at 22:46, Prof Brian Ripley wrote:
See e.g.
http://finzi.psych.upenn.edu/R
properly use the
underlying Fortran code.
Baptiste
On 9 Nov 2008, at 12:22, baptiste auguie wrote:
Dear all,
I'm writing a code that requires Bessel functions with complex
argument.
Searching the list, I found the continuation of a thread I initiated
a few
months ago:
http://tolsto
I believe you can simply modify the panel function to replot the axes
on top with panel.axis(),
library(lattice)
model <- function(a,b,c,d,e, f, X1,X2) # provide model function
# for contour plot
{J <- a + (b*X1) + (c*X2) + (d*X1*X2) + e*(X1^2) + f*(X2^2)
pp <- exp(J)/(1+exp(J))
re
Dear list,
I need to align two plots on top of each other for comparison (they
only have the x-axis in common). When the y-labels have a different
extent, I cannot find a way to align the x-axes, as illustrated below,
library(grid)
library(lattice)
x <- seq(0, 10, length=100)
y <- sin(x)
Hi,
The main difference I saw between your two graphs was the stacking,
which you can obtain by stack=TRUE in lattice. I'm not sure what
cosmetic issues you had in mind. Perhaps you can try this,
barchart(y~dfb|dfyr,dataf,layout=c(3,1),stack=T,ylim=c(0, 2.7),
groups=dfa, strip
Many thanks, this tool from latticeExtra does exactly what I was
trying to achieve!
Best wishes,
Baptiste
On 1 Dec 2008, at 20:06, Deepayan Sarkar wrote:
In general, the latticeExtra package has some tools to combine
arbitrary trellis objects (thanks to Felix Andrews):
library(latticeExtr
Dear list,
I've written a small utility function to add arbitrary legend(s) to a
lattice graph (or a combination of them), much like the legend
function of base graphics. I though perhaps it could be useful to
someone else, or improved by suggestions. I understand this goes
against the l
A few personal thoughts on this:
I recently joined a newly created R user group on google < http://groups.google.co.uk/group/gur-ugr
> that started with a similar impulse.
In my personal opinion, I see little overall benefit from such an
approach. For one thing, a major strength of the R ma
Hi,
"font" should be an integer as described in ?par. I think you want to
play with cex.main (possibly cex in combination, depending on what
your are plotting)
x <- seq(0, 10)
pdf(width=8, height=20)
par(mfrow=c(45, 8), mai=c(0,0.1,0.1,0))
sapply(1:(45*8), function(ii) {
plot(x,
Dear list,
I have a data.frame with x, y values and a 3-level factor "group",
say. I want to create a new column in this data.frame with the values
of y scaled to 1 by group. Perhaps the example below describes it best:
x <- seq(0, 10, len=100)
my.df <- data.frame(x = rep(x, 3), y=c(3*sin(
Excellent! I completely forgot its name and existence. Perhaps ave
should be mentioned on the help page of either by, tapply, split.
Many thanks,
baptiste
On 10 Dec 2008, at 17:20, Chuck Cleland wrote:
On 12/10/2008 12:02 PM, baptiste auguie wrote:
Dear list,
I have a data.frame with x
On 10 Dec 2008, at 17:25, hadley wickham wrote:
On Wed, Dec 10, 2008 at 11:02 AM, baptiste auguie
<[EMAIL PROTECTED]> wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor "group",
say. I
want to create a new column in this data.frame with the valu
From the code of legend() the length seems to be hard-wired (seg.len
= 2). You could copy the code and add this "seg.len" as a free
parameter in your own custom function. An alternative is to use the
lattice package which has a size argument for this purpose. See ?
xyplot in the key section.
Hi,
Good idea, what do you say we try and write a page on this in the R
wiki?
I started the topic:
http://wiki.r-project.org/rwiki/doku.php?id=guides:overview-data-manip
Once the content is there, it wouldn't be much of an effort to create
a reference-card format if required.
Best wishes
Hi,
Perhaps you can use expand.grid and then remove the mirror combinations,
values <- 1:3
tmp <- expand.grid(values, values)
unique.combs <- tmp[tmp[, 1]<=tmp[, 2], ]
unique.combs[do.call(order, unique.combs), ] # reorder if you wish
Var1 Var2
111
412
713
522
have you tried do.call(rbind, aa) , or perhaps do.call(merge, aa) ?
Hope this helps,
baptiste
On 15 Dec 2008, at 13:23, 江文恺 wrote:
Dear all:
I have a list of dataframes like this, i try to merge this lists of
dataframes into one single dataframe, and keep ther column names as
usual, how
701 - 738 of 738 matches
Mail list logo