Re: [R] Passing lists between functions

2012-11-25 Thread Ally
Thanks Rolf, that was a mistake. Brilliant, I think with() is what I'm looking for, thanks a lot! cheers, alastair Rolf Turner-3 wrote > On 26/11/12 14:24, Ally wrote: >> I'd like to pass a list object created by one function as an argument of >> another function

Re: [R] Passing lists between functions

2012-11-25 Thread Ally
I should have been clearer, the function I supplied is just a toy example, I actually have lots more elements, each with different classes, and need to do more complex things than just summation. The main reason I'm interested in this is to avoid having to keep adding an assignment like x<-lst$x e

[R] Passing lists between functions

2012-11-25 Thread Ally
I'd like to pass a list object created by one function as an argument of another function. once inside the second function, I'd like to break the list up to it's individual elements, each then identifiable by the 'names' of the list. The list looks something like lst<-list(a=1, b=2, df=5, g=7)

Re: [R] Identify points that lie within polygon

2012-08-06 Thread Ally
----- > Sent from my phone. Please excuse my brevity. > > Ally <a.rushworth@.ac> wrote: > >>I have a complex 2D polygon with thousands of vertices, and I'd like to >>be >>able to identify points from a large set contained within the polygo

[R] Identify points that lie within polygon

2012-08-06 Thread Ally
I have a complex 2D polygon with thousands of vertices, and I'd like to be able to identify points from a large set contained within the polygon, and was wondering if there might be an efficient way of doing this? Any advice would be useful! Here is a small example of what I mean: # make polygon

[R] Row-wise kronecker product with Matrix package

2012-02-09 Thread Ally
I'm trying to calculate the row-wise kronecker product A \Box B of two sparse matrices A and B, and am struggling to find a quick way to do this that takes advantage of sparseness. I thought a good idea would be to use "rep" to construct 2 matrices of the same dimension of the end product, and m

[R] help with using grid.polygon()

2010-08-04 Thread Ally
Hi, I'm trying to use grid.polygon() to plot several polygons at once, with a view to putting coloured polygons beneath a curve. I'm struggling just to get the grid.polygon to plot anything # PLOT SOME POINTS x <- 1:100 y <- 1:100*0.5 + 3 plot(x, y, pch = ".") # PLOT 2

Re: [R] Plot - specification for grid of x axis

2010-02-02 Thread Ally
Have a look at ?par and check out the 'xaxp' parameter par(mfrow=c(1,2)) plot(x[,2] ~ x[,1], xaxp=c(0,100,5)) plot(x[,2] ~ x[,1], xaxp=c(0,100,10), cex.axis=0.5) -- View this message in context: http://n4.nabble.com/Plot-specification-for-grid-of-x-axis-tp1460005p1460083.html Sent from the R h