Displaying 20 results from an estimated 10000 matches similar to: "matching lists"
2008 Nov 09
1
[Rd] Re Bessel functions of complex argument
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 fortran or C
implementation of Amos,
2009 Jun 01
1
Fwd: subset dataframe/list
--- the forwarded message follows ---
-------------- next part --------------
An embedded message was scrubbed...
From: "Cecilia Carmo" <cecilia.carmo at ua.pt>
Subject: Re: [R] subset dataframe/list
Date: Mon, 01 Jun 2009 21:33:15 +0100
Size: 3657
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090601/921f7638/attachment-0002.mht>
2009 May 11
3
aggregate over x cases
Hello,
I have been struggling for quite some time to find a solution for the following problem. I have a data frame which is organized by block and trial. Each trial is represented across several rows in this data frame. I'd like to extract the first x rows per trial and block.
For example
block trial x y
1 1 1 605 150
2 1 1 603 148
3 1 1 604 140
4 1 1 600 140
5 1 1 590 135
6 1 1 580 135
7
2009 Mar 27
3
color vectors other than gray()
I'm trying to create a graph where different cells of a grid (a shapefile)
will be painted with a color share scale, where the most easy way is to use
gray().
Can I somehow get a vector (gradient) of colors, a vector of colors with
other methods but gray()?
I'm doing this until now
quad_N_sp <-
2009 Mar 25
2
"[.data.frame" and lapply
Dear all,
Trying to extract a few rows for each element of a list of
data.frames, I'm puzzled by the following behaviour,
> d <- lapply(1:4, function(i) data.frame(x=rnorm(5), y=rnorm(5)))
> str(d)
>
> lapply(d, "[", i= c(1)) # fine, this extracts the first columns
> lapply(d, "[", j= c(1, 3)) # doesn't do nothing ?!
>
> library(plyr)
2009 Mar 25
2
"[.data.frame" and lapply
Dear all,
Trying to extract a few rows for each element of a list of
data.frames, I'm puzzled by the following behaviour,
> d <- lapply(1:4, function(i) data.frame(x=rnorm(5), y=rnorm(5)))
> str(d)
>
> lapply(d, "[", i= c(1)) # fine, this extracts the first columns
> lapply(d, "[", j= c(1, 3)) # doesn't do nothing ?!
>
> library(plyr)
2008 Jun 18
2
highest eigenvalues of a matrix
DeaR list,
I happily use eigen() to compute the eigenvalues and eigenvectors of
a fairly large matrix (200x200, say), but it seems over-killed as its
rank is limited to typically 2 or 3. I sort of remember being taught
that numerical techniques can find iteratively decreasing eigenvalues
and corresponding orthogonal eigenvectors, which would provide a nice
alternative (once I have the
2009 Jun 25
3
grid.polygon() + color gradient
Hi,
I wonder whether there is a way to generate a polygon (a triangle in
my case) with color gradient using grid.polygon() in package grid?
I tried something like
library(grid)
grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA,
fill=colorRampPalette(c("green", "lightgray"),
space="Lab")(200)))
But am only
2009 Apr 16
3
segment between points on different plots
Hi,
I need to draw a line segment between two points on different plots in the
same multigraph.I've tried looking at the zoominplot function in plotrix but
havent understood much.any help is appreciated
~Aks
[[alternative HTML version deleted]]
2009 Apr 14
2
subset dataframe by rows using character vector?
Dear List,
I'm stuck on what seems like a simple indexing problem, I'd be very grateful to anyone willing to help me out.
I queried a dataframe which returns a character vector called "plot". I have another dataframe from which I want to subset or select only those rows that match "plot". I've tried subset, and also the "which" command.
plot
2009 Mar 09
3
How to write a function that accepts unlimited number of input arguments?
Dear R-helpers:
I am an R newbie and have a question related to writing functions that
accept unlimited number of input arguments.
(I tried to peek into functions such as paste and cbind, but failed, I
cannot see their codes..)
Can someone kindly show me through a summation example?
Say, we have input scalar, 1 2 3 4 5
then the ideal function, say sum.test, can do
2009 Apr 03
3
plyr and table question
Dear all,
I'm puzzled by the following example inspired by a recent question on
R-help,
cc <- textConnection("user_id website time
20 google 0930
21 yahoo 0935
20 facebook 1000
25 facebook 1015
61 google 0940")
d <- read.table(cc, head=T) ; close(cc)
table(d$user_id) # count the
2008 Apr 03
1
data.frame or list
Dear R list,
I'm having difficulties in choosing between a list or a data.frame,
or an array for the storage and manipulation of my data (example
follows). I've been using the three for different purposes but I
would rather like to know which is more adapted to what task.
Here is the data I'm currently working on: 200 observations, each
observation being a vector of length
2008 Feb 03
1
distances between points in R^3
Dear R helpers,
I'm trying to write a numerical scheme for a boundary integral method
to solve an electromagnetic problem. This requires the computation of
the distance between points at the surface of an object (a sphere, in
my example). Here is my code,
> require(rgl)
> r<-1
> size<-10
> theta<-seq(0,2*pi,length=size*2)
> phi<-seq(0,pi,length=size)
> pc
2008 Feb 18
2
question on function arguments
Hi,
I have two small issues with my R code, no big deal but curiosity
really. Here is a sample code,
>
> x <- rnorm(1:10)
>
> foo <- function(a = 1, b = list(x = c(1:10), y = c(1:10))){
>
> for (ii in seq(along=b$y)){
>
> print(x[ii] + b$x[ii])
> }
>
>
> }
>
> foo() # default OK
>
> foo(b=list(x=1, y=c(1:10))) # only the first
2008 Jul 03
1
ggplot2 legend for vertical lines
Dear all,
The following example code produces a graph with ggplot2, to which I
add several vertical lines of arbitrary colors. I am not satisfied
with the legend: it automatically adds some vertical lines which I'd
rather not see (they confuse the reader rather than add information
in this case).
> library(ggplot2)
> dfr <- data.frame(values = sin(1:50/10),
> fact =
2008 Apr 26
6
quasi-random sequences
Dear list useRs,
I have to generate a random set of coordinates (x,y) in [-1 ; 1]^2
for say, N points. At each of these points is drawn a circle (later
on, an ellipse) of random size, as in:
> N <- 100
>
> positions <- matrix(rnorm(2 * N, mean = 0 , sd= 0.5), nrow=N)
> sizes<-rnorm(N, mean = 0 , sd= 1)
> plot(positions,type="p",cex=sizes)
My problem is to
2009 May 27
3
Axis label spanning multiple plots
Hello
I need to plot 3 graphs in a single column; the top two plots have the
same title, and I would like it to be written only once, centered
horizontally and spanning the two plots. Something like
t +------------+
| |
i | |
| |
t +------------+
l +------------+
| |
e | |
| |
1 +------------+
t
2008 Aug 09
2
levels values of cut()
Dear list,
I have the following example, from which I am hoping to retrieve
numeric values of the factor levels (that is, without the brackets):
>
> x <- seq(1, 15, length=100)
> y <- sin(x)
>
> my.cuts <- cut(which(abs(y) < 1e-1), 3)
> levels(my.cuts)
hist() does not suit me for this, as it does not necessarily respect
the number of breaks.
getAnywhere
2008 Dec 10
4
tapply within a data.frame: a simpler alternative?
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(x), 2*cos(x),
> cos(2*x)), # note how the y values have a different