similar to: Na/NaN error in subsampling script

Displaying 20 results from an estimated 2000 matches similar to: "Na/NaN error in subsampling script"

2011 Sep 08
1
random sampling but with caveats!
Hi, I wonder if someone can help me. I have built a gam model to predict the presence of cold water corals and am now trying to evaluate my model by splitting my dataset into training/test datasets. In an ideal world I would use the sample() function to randomly select rows of data for me so for example with 936 rows of data in my HH dataset I might say ss <- sample(nrow(HH), size =
2011 May 21
2
unbalanced anova with subsampling (Type III SS)
Hello R-users, I am trying to obtain Type III SS for an ANOVA with subsampling. My design is slightly unbalanced with either 3 or 4 subsamples per replicate. The basic aov model would be: fit <- aov(y~x+Error(subsample)) But this gives Type I SS and not Type III. But, using the drop() option: drop1(fit, test="F") I get an error message: "Error in
2005 Jan 14
5
subsampling
hi, I would like to subsample the array c(1:200) at random into ten subsamples v1,v2,...,v10. I tried with to go progressively like this: > x<-c(1:200) > v1<-sample(x,20) > y<-x[-v1] > v2<-sample(y,20) and then I want to do: >x<-y[-v2] Error: subscript out of bounds.
2009 Apr 06
3
how to subsample all possible combinations of n species taken 1:n at a time?
Hello I apologise for the length of this entry but please bear with me. In short: I need a way of subsampling communities from all possible communities of n taxa taken 1:n at a time without having to calculate all possible combinations (because this gives me a memory error - using combn() or expand.grid() at least). Does anyone know of a function? Or can you help me edit the combn or
2012 Aug 16
1
Big Data reading subsample csv
Hello, I'm most grateful for your time to read this. I have a uber size 30GB file of 6 million records and 3000 (mostly categorical data) columns in csv format. I want to bootstrap subsamples for multinomial regression, but it's proving difficult even with my 64GB RAM in my machine and twice that swap file , the process becomes super slow and halts. I'm thinking about generating
2011 Aug 11
1
Subsampling data
*Dear R community* * * *I have two questions on data subsample manipulation. I am starting to use R again after a long brake and feel a bit rusty.* * * *I want to select a subsample of data for males and females separately* * * library(foreign) Datatemp <- read.spss("H:/Skjol/Data/HL/t1and2b.sav", use.value.labels = F) > table(Datatemp$sex) 1 2 3049 3702
2011 Feb 06
2
Subsampling out of site*abundance matrix
Hello, How can I randomly sample individuals within a sites from a site (row) X species abundance (column) data frame or matrix? As an example, the matrix "abund2" made below. ##### (sorry, Im a newbie and this is the only way I know to get an example on here) abund1 <- c(150, 300, 0, 360, 150, 300, 0, 240, 150, 0, 60, 0, 150, 0, 540, 0, 0, 300, 0, 240, 300, 300,
2010 Nov 09
1
subsampling table
G'day R-helpers, I want to subsample rows of a large table based on the value in its first column. Of all rows sharing the same value in the first column I want to RANDOMLY extract only one. Thanks in advance, Achim example input 1 15 34 1 4 66 1 24 65 2 23 47 2 9 36 3 58 9 3 38 64 3 12 64 3 4 15 4 1 88 4 23 90 desired output 1 4 66 2 23 47 3 12 64 4 1 88
2008 Nov 15
1
GAMs and GAMMS with correlated acoustic data
Greetings This is a long email. I'm struggling with a data set comprising 2,278 hydroacoustic estimates of fish biomass density made along line transects in two lakes (lakes Michigan and Huron, three years in each lake). The data represent lakewide surveys in each year and each data point represents the estimate for a horizontal interval 1 km in length. I'm interested in comparing
2011 Nov 01
1
Subsampling-oversampling from a data frame
If no one has a better solution, split it, take a sample of size X from both and put it back together. hgwelec wrote: > > Dear members, > > Consider the following data frame (first 4 rows shown) > > > age sex class > 15 m low > 20 f high > 15 f low > 10 m low > > in my original data set i have 1200 rows and a class distribution
2008 Aug 17
1
before-after control-impact analysis with R
Hello everybody, In am trying to analyse a BACI experiment and I really want to do it with R (which I find really exciting). So, before moving on I though it would be a good idea to repeat some known experiments which are quite similar to my own. I tried to reproduce 2 published examples but without much success. The first one in particular is a published dataset analysed with SAS by
2011 Nov 12
1
Subsetting data leads to funky plots
I'm trying out a basic plot, but something about the way I subset my data leads to problems with the plot. Here is the first bit of my data set year,date,location,quadrat_juvenile,photo_location,photo_exists,genus,count,divers 2005,2005-04-30, 1 Fringing Reef,1, 1 Fringing Reef Coral Transect Pole 1-2 Quadrat 1,t,Acanthastrea,0,HP+MEM 2005,2005-04-30, 1 Fringing Reef,1, 1 Fringing Reef
2006 Feb 26
2
subtotal, submean, aggregate
Dear All, I would like to make partial sums (or means or any other function) of the values in intervals along a sequence (spatial transect) where groups are defined. For instance: habitats<-rep(c("meadow","forest","meadow","pasture"),c(10,5,12,6)) observations<-rpois(length(habitats),2)
2010 Oct 31
2
Randomly split a sample in two equal subsamples
Dear all, I would like to randomly split a sample in two equally large subsamples. The sample data is stored as a matrix with each row representing an individual and each column representing some variable (e.g., name, age, sex, etc.); the first row contains the names of the variables; the first column contains the individual number (1:n, for n individuals); the number of individuals is even (so,
2011 Apr 28
1
using lme4 with three nested random effects
Hi all, I'm trying to fit models for data with three levels of nested random effects: site/transect/plot. For example, modelincrBS<-glmer(l.ru.ba.incr~shigo.av+pre.f.crwn.length+bark.thick.bh+Date+slope.pos.num+dens.T+dbh+leaf.area+can.pos.num+(1|site/transect/plot), data=rws30.UL, family=gaussian, na.action=na.omit) but I get the following error: Error: length(f1) == length(f2) is not
2010 Aug 13
1
loop for inserting rows in a matrix
Dear R friends, I have a matrix with 2060 rows and 41 columns. One column is Date, another is Transect, and another is Segment. I want to ensure that there are 9 Transects (1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the matrix, by inserting rows where these are missing. I am new to coding, but am trying to write a loop which checks if each of the transects already
2005 Jan 06
1
GLMM and crossed effects
Hi again. Perhaps a simple question this time.... I am analysing data with a dependent variable of insect counts, a fixed effect of site and two random effects, day, which is the same set of 10 days for each site, and then transect, which is nested within site (5 each). I am trying to fit the cross classified model using GLMM in lme4. I have, for potential use, created a second coding
2006 Mar 18
2
extraction - subsets
Hi everybody, let us assume i have the following matrixX and vectorY matrixX <- runif(100) dim(matrixX) <- c(10,10) vectorY <- as.matrix(as.character(seq(1,10))) if I define: subsample<-c("2") i can extract the rows from matriX based on the elements in vectorY which are listed in subsample matrixX[vectorY==subsample] if I define subsample with more than 1 element, such
2011 Nov 18
1
One-way repeated measures ANOVA
Hi all, I'm trying to run a repeated measures ANOVA on some univariate ecological data that was collected over two growing seasons. I ran the test using the methodology found on this website: http://rtutorialseries.blogspot.com/2011/02/r-tutorial-series-one-way-repeated.html Upon running the actual ANOVA I got this error message: "> rmanova=anova(yearmodel, idata=yearframe,
2004 Jul 26
1
group definition for a bootstrap
Hi, This is probably really simple, but I am clearly not R-minded, I have read the help files, and reread them, and I still can't work out what to do... I have a data frame (d) with 3 columns (age (0-5), quarter (1-4) and x). I want to estimate the precision of my mean x by age and quarter, so I want to carry out a bootstrap for each group. I am trying to do this within a loop, so I don't