[R] row sum question

2008-12-22 Thread keunhchoi
Dear helpers, I'm using R version 2.8.0. Suppose that I have a small data set like below. [,1] [,2] [,3] [,4] a1100 b0110 c1110 d0111 First, I'd like to find sum of each row uniquely present in each row, but only sequentially

[R] data type problem for vegan package

2008-11-11 Thread keunhchoi
Dear all, I'm using R2.8 version, and am trying to do NMDS and calculate other diversity indices in vegan package. The problem is that it works with a small set of data (43 X 23; row by column), but the following error message comes up with a larger data set (43 X 104) (it seems not large to me

[R] read.table with many blanks (reposting)

2008-11-11 Thread keunhchoi
Thanks Jim for pointing out how to properly ask. Here is is my question and a small subset of the data and output. I have a data set with many blanks. The blanks should be replaced with zero once imported. I tried read.table, read.csv (R 2.8 version),or scan, but none was successful. Any

[R] optim error - repost

2008-06-01 Thread keunhchoi
Here is a clean version. I did this with nls and it works (see below), but I need to do it with optim. Keun-Hyung # optim vol-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3) time-rep(c(2,4,8),each=7) p.mated-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, NA, 0.68, 0.62, 0.64, 0.58, 0.53, 0.47, 0.24, 0.8, 0.79,

[R] optim error

2008-05-31 Thread keunhchoi
I saw a similar question but I still don't fully understand how to implement optim. Can someone help me out with this? Thanks. Keun-Hyung vol-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3) time-rep(c(2,4,8),each=7) p.mated-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, null, 0.68, 0.62, 0.64, 0.58, 0.53, 0.47,