[R] RMark error: only 0's may be mixed with negative subscripts

2010-11-07 Thread Umesh Srinivasan
tories in the file 'capture history.txt' as well if that will help. Thanks in advance, Umesh Srinivasan National Centre for Biological Sciences Bangalore, India "ch" "1" "01" "3" "110111" "4" "011001" "5" &q

[R] plotting two surfaces simultaneously in a single panel

2009-11-27 Thread Umesh Srinivasan
trawling the net are helping me find how to do this. Can someone help? Thanks Cheers, Umesh Srinivasan NCBS-TIFR, Bangalore, India __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] interpreting glmer results

2009-10-05 Thread Umesh Srinivasan
rly, distance from the tree has an effect, but I want to know whether the identity of the species influences seedling numbers in general. I am unable, however, to make much sense of the output. Also, what does correlation of fixed effects really tell me? Many thanks for any help. Cheers, Umesh

Re: [R] selecting ith rows of a matrix

2009-04-29 Thread Umesh Srinivasan
t; mat[seq(1, nrow(mat), 3), ] > mat[seq(1, nrow(mat), 4), ] > > > I hope it helps. > > Best, > Dimitris > > > Umesh Srinivasan wrote: > >> Hi all, >> >> If I have a huge matrix/ dataframe and I want to create a new matrix/ >> dataframe with eve

[R] selecting ith rows of a matrix

2009-04-29 Thread Umesh Srinivasan
Hi all, If I have a huge matrix/ dataframe and I want to create a new matrix/ dataframe with every second (or third, or fourth etc.) row of the original matrix, how can I do it? Any help much appreciated. Thanks, Umesh [[alternative HTML version deleted]] __

Re: [R] Finding rows common to two datasets

2009-04-28 Thread Umesh Srinivasan
Dear Steve, Can you show us a small sample of your two data frames (maybe the top twenty or so rows)? Maybe things will become clearer then. I don't think 'unique' will help you very much with this. What you can do alternatively (though less elegantly!) do is use a 'for' loop. This would probably

Re: [R] Finding rows common to two datasets

2009-04-28 Thread Umesh Srinivasan
Dear Steve, Try ? intersect and see if that might help. Cheers, Umesh On Tue, Apr 28, 2009 at 1:29 PM, Steve Murray wrote: > > Dear all, > > I have 2 data frames, both with 14 columns of data and differing numbers of > rows. The first two columns are 'Latitude' and 'Longitude'. I want to find

Re: [R] Coloring X and Y axis

2009-04-11 Thread Umesh Srinivasan
Hi Gundala, If you want your plotting axes to appear in colour, try par(fg = "red") # will colour all foreground stuff in red, including the axes. Cheers, Umesh On Sat, Apr 11, 2009 at 3:51 PM, Jim Lemon wrote: > Gundala Viswanath wrote: > >> Dear all, >> >> Is there a way to do it? >> >> Th

Re: [R] axis colours

2009-04-05 Thread Umesh Srinivasan
Thanks a lot. That's what I was looking for. Must have missed the fg bit in the ? par. Cheers, Umesh On Sun, Apr 5, 2009 at 3:19 AM, Duncan Murdoch wrote: > On 04/04/2009 5:13 PM, Umesh Srinivasan wrote: > >> Hi, >> >> Is there a way to use par to change the colou

[R] axis colours

2009-04-04 Thread Umesh Srinivasan
Hi, Is there a way to use par to change the colours of the axes lines (not the labels)? I've done this: par(bg = "black") plot(x, y, col = "yellow", pch = 16) but I have to use axes = F within the plot command, and then use axis (1, col = "yellow") axis (2, col = "yellow") and so on for axes

Re: [R] how to sort and plot data?

2009-04-03 Thread Umesh Srinivasan
Hi, There is definitely a more elegant way of doing this which I don't know about (without a for loop), but try this: mat <- matrix(NA, nrow = max(user_id), ncol = 2) mat[,1] <- 1:max(user_id) # 1st column of matrix is the user ID for (i in 1:max(user_id)){ temp1 <- subset(data, user_id = i) temp

Re: [R] Merging rows in dataframes

2009-03-29 Thread Umesh Srinivasan
Hi, Not exactly sure what you mean, but try ? intersect and see if this matches your need. Cheers, Umesh On Sun, Mar 29, 2009 at 6:28 PM, Gabor Grothendieck wrote: > Example 7c has been aded to the home page which illustrates how > to do this using nested selects. > http://sqldf.googlecode.

Re: [R] generalized Poisson regression

2009-03-24 Thread Umesh Srinivasan
Hi, Not exactly sure what you mean, but if you want to run a poisson regression and then look at the coefficients, then this is what you need: poisson.model <- glm(response ~ predictor, family = "poisson") summary(poisson.model) Will give you the intercept and slope. Since poisson regression us

Re: [R] limiting simulated animal movement

2009-03-22 Thread Umesh Srinivasan
Wow, that was really quick, thanks a lot. Will try this and get back to you. Cheers, Umesh On Sun, Mar 22, 2009 at 3:52 PM, Jim Lemon wrote: > Umesh Srinivasan wrote: > >> Hi, >> >> I am trying to simulate animal movement in a gridded landscape made up of >> cells

[R] limiting simulated animal movement

2009-03-21 Thread Umesh Srinivasan
Hi, I am trying to simulate animal movement in a gridded landscape made up of cells. At each time step (iteration), the animal moves from one cell to another in a random fashion. This is how I am simulating movement, where a and b are the x,y co-ordinates of the animal at the previous time step: