Re: [R] Average of Two Matrices

2011-11-30 Thread T.D. Rudolph
What if you have over 50 matrices and you don't want to write them all out one-by-one? I know there's something really quite simple, but I haven't found it yet!... -- View this message in context: http://r.789695.n4.nabble.com/Average-of-Two-Matrices-tp860672p4126615.html Sent from the R help m

[R] "each" argument in rep (Bug?)

2011-02-01 Thread T.D. Rudolph
I have a vector of unique elements that I want to replicate a variable number of times depending on the element (lengths all > 800). However I noticed that the resulting length was not the sum of the each argument. The following example demonstrates this. I am confused as to why this works:

[R] another superscript problem

2010-12-27 Thread T.D. Rudolph
I've exceeded the maximum time I am willing to accept for solving simple problems so I thank all in advance for your assistance. I am trying to plot text combined with an object value and a superscript. obv = 5 text = "Population mean =" ss = ^o # degrees Something like this (very naive so yo

[R] truncate integers

2010-11-13 Thread T.D. Rudolph
Is there any really easy way to truncate integers with several consecutive digits without rounding and without converting from numeric to character (using strsplit, etc.)?? Something along these lines: e.g. = 456 truncfun(e.g., location=1) = 4 truncfun(e.g., location=1:2) = 45 truncfun(e.g.,

Re: [R] Want to exclude a column when using sample function

2010-07-14 Thread T.D. Rudolph
sample(data, 3, replace=FALSE)[,-1:2] or sample(data, 3, replace=FALSE)[,-c("id","pID50")] Tyler On Wed, Jul 14, 2010 at 1:17 PM, Addi Wei [via R] < ml-node+2289092-1912443153-77...@n4.nabble.com > wrote: > id pID50 apol a_acca_acid a_aro a_base a_count > 1 mol.11 3.63

Re: [R] Rename column or row names

2010-07-13 Thread T.D. Rudolph
this isn't a whole lot different, but if x is a data.frame (and not a matrix), you could also try this: names(x)[which(names(x)=="oldname")]= "newname" -- View this message in context: http://r.789695.n4.nabble.com/Rename-column-or-row-names-tp2288122p2288183.html Sent from the R help mailing

Re: [R] create variables with indexes

2010-07-13 Thread T.D. Rudolph
Here is another way of going about it (presuming we are correct about what you are after): i=1:10 j=1:10 unlist(lapply(i, function(x) paste("X", x, j, sep="_"))) Tyler -- View this message in context: http://r.789695.n4.nabble.com/create-variables-with-indexes-tp2288119p2288171.html Sent from

Re: [R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread T.D. Rudolph
Henrique is correct; entering duplicated(df) will return an index of TRUE or FALSE for every row. TRUE indicates a duplicated row. df[duplicated(df),] # shows which rows are repeated df[-duplicated(df),] # shows which rows are unique -- View this message in context: http://r.789695.n4.nabble.

Re: [R] Want to exclude a column when using sample function

2010-07-13 Thread T.D. Rudolph
It's not really clear what the structure of your data is, nor how exactly you are sampling it (you need to provide an example), but you could try adding this to the end of your sample command (if the result is a data.frame or matrix): [,-1] Tyler -- View this message in context: http://r.789695

[R] potential BUG in BBMM

2010-07-13 Thread T.D. Rudolph
http://r.789695.n4.nabble.com/file/n2287976/BBMM_BUG.RData BBMM_BUG.RData I've been constructing utilization distributions for 63 animal movement trajectories using a Brownian bridge movement model with BBMM. I started noticing after running the routine numerous times at different resolutions t

Re: [R] Need help on index for time series object

2010-07-13 Thread T.D. Rudolph
which(!is.na(dat1)) -- View this message in context: http://r.789695.n4.nabble.com/Need-help-on-index-for-time-series-object-tp2287926p2287948.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://s

[R] plot circular histogram

2010-02-19 Thread T.D. Rudolph
In conducting studies of animal orientation and displacement, I need to produce circular histograms of angles (bearings in radians 0-2pi) where the centre of the circle indicates very few observations for a given bin of angles and outwardly concentric circles indicate greater frequencies of observ