similar to: random sampling with some limitive conditions?

Displaying 20 results from an estimated 300 matches similar to: "random sampling with some limitive conditions?"

2006 Oct 13
3
multiply two matrixes with the different dimension column by column
Dear all, I would like to multiply two matrixes with the different dimension column by column. Let make an example: If I have two matrixes "X" and "Y"as follow: X<- matrix(1:12, nrow=4, ncol=3, dimnames=list(c("A","B","C","D"), c("stage1","stage2","stage3"))) Y<- matrix(1:28, nrow=4, ncol=7,
2006 Oct 12
3
Cross two dataframe
Dear r-users! I would like to cross two data frame which have the same row number but different in the number of column. Can anybody help me for this case ? Thanks a lot in advance -------------------------------------------------------------------------------- Majid Iravani PhD Student Swiss Federal Research Institute WSL Research Group of Vegetation Ecology Z?rcherstrasse 111
2005 Jun 16
1
mu^2(1-mu)^2 variance function for GLM
Dear list, I'm trying to mimic the analysis of Wedderburn (1974) as cited by McCullagh and Nelder (1989) on p.328-332. This is the leaf-blotch on barley example, and the data is available in the `faraway' package. Wedderburn suggested using the variance function mu^2(1-mu)^2. This variance function isn't readily available in R's `quasi' family object, but it seems to me
2006 Sep 26
1
How to "Pack" a matrix
Hello, Suppose I have a matrix a where a= sp1 sp2 sp3 sp4 sp5 sp6 site1 1 0 1 1 0 1 site2 1 0 1 1 0 1 site3 1 1 1 1 1 1 site4 0 1 1 1 0 1 site5 0 0 1 0 0 1 site6 0 0 1 0 1 0 And I want to pack that matrix so that the upper left corner contains most of the ones and the bottom right corner contains most of the zeros so that matrix b is b= sp3 sp6 sp4 sp1 sp2 sp5 site1 1 1 1 1 0 0 site2
2005 Nov 03
4
merging dataframes
Dear List, I often have to merge two or more data frames containing unique row names but with some columns (names) common to the two data frames and some columns not common. This toy example will explain the kind of setup I am talking about: mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5)) mat2 <- as.data.frame(matrix(rnorm(20), nrow = 4)) rownames(mat1) <- paste("site",
2009 Feb 03
1
overlaying plots from a list of data frames
Hello R list, I have a list of data frames, in the form (dump output for an example list follows message): $site1 year data 1 2000 0.03685042 2 2001 0.02583885 6 2005 0.02480015 7 2006 0.03458745 $site2 year data 1 2002 4.071134e-03 2 2003 -4.513524e-08 3 2004 8.336272e-08 4 2005 2.270803e-08 5 2006 1.263597e-02 6 2007 NaN I would like to plot each
2011 Nov 01
1
Multiple time series with zoo
Thanks for everyone's input so far, it is greatly appreciated. But I've got one last task I could use some advice on Here are the first few lines of my data set: site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63 06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56 06,2006-04-09
2012 May 14
2
How to interpret an ANOVA result?
Hello all, here's a real-world example: I'm measuring a quantity (d) at five sites (site1 thru site5) on a silicon wafer. There is a clear site-dependence of the measured value. To find out if this is a measurement artifact I measured the wafer four times: twice in the normal position (posN), and twice rotated by 180 degrees (posR). My data looks like this (full, self-contained code at
2006 Aug 29
1
Bootstraping for groups and subgroups and joing with other table
Dear R-experts, I have a table with following collumns: State, SamplePlot, Species and BodySize. I sampled bird species at 34 SamplePlots and 5 States (regions) monthly during two years. On each bird record I measured bodysize and identified the species. So I have many records of each species (about 150 species) at each SamplePlot and each Region (State). Now I would like bootstrap
2005 Feb 09
4
subset
Dear all, I am trying to extract rows from a data.frame based on the rowSums != 0. I want to preserve rownames in the first column in the subset. Does anyone know how to extract all species that don't have rowSums equal to zero? Here it is: # dataset x <- data.frame( species=c("sp.1","sp.2","sp.3","sp.4"), site1=c(2,3,0,0), site2=c(0,0,0,0),
2018 Apr 18
3
How to replace numeric value in the column contains Text (Factor)?
Hi R user, Would you mind to help me on how I can change a value in a specific column and row in a big table? but the column of the table is a factor (not numeric). Here is an example. I want to change dat[4:5,3]<-"20" but it generated NA> do you have any suggestions for me? dat<-structure(list(Sites = structure(1:5, .Label = c("Site1", "Site2",
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,
2007 Aug 13
3
Very new - beginners questions
Dear all, I have 4 sites and want to determine how different they are from each other. For this I have decided to use R though it seems a bit daunting to learn. I have read data in from a CSV the structure is : Species1 Species2 Species3 Site1 4 4 7 Site2 3 1 0 Site3 0 99 6 Site4 75 3 33 There are many more species than shown above this is just an example. Here are the
2018 Apr 18
0
How to replace numeric value in the column contains Text (Factor)?
The simplest would be to convert precip to character and then back to a factor if you really want it to be a factor. This will also remove the levels that no longer exist. str(dat) # 'data.frame': 5 obs. of 3 variables: # $ Sites : Factor w/ 5 levels "Site1","Site2",..: 1 2 3 4 5 # $ temp : num 14 15 12 12.5 17 # $ precip: Factor w/ 5 levels
2006 Aug 29
0
En: Bootstraping for groups (right data tables)
Dear R-friends, Unfortunately the tables that I "past" on last email gone with bad visual structure. So I send it again. Sorry to do this so confuse. Miltinho ==== Table1 - Bird records State,SampleSite,Species,Bodysize SaoPaulo,Site1,Spp01,4.39 SaoPaulo,Site1,Spp04,4.05 SaoPaulo,Site1,Spp01,2.75 SaoPaulo,Site1,Spp02,8.18 SaoPaulo,Site1,Spp02,0.80
2007 Mar 24
1
frequency tables and sorting by rowSum
Dear list, I have some trouble generating a frequency table over a number of vectors. Creating these tables over simple numbers is no problem with table() > table(c(1,1,1,3,4,5)) 1 3 4 5 3 1 1 1 , but how can i for example turn: 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 into 0 0 1 1 1 0 0 2 0 1 0 3 My second problem is, sorting rows and columns of a matrix by the rowSums/colSums. I did it
2011 Oct 23
3
How to create a new variable based on parts of another character variable.
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111023/ae046d6a/attachment.pl>
2006 Nov 13
9
Setting up Mongrel and Apache , some direction needed
I have a site that is PHP on Apache / RedHat , but will send requests to a subdomain (running Rails) for database operations. I believe the set up should be to have ROR using Mongrel, and an Apache virtual host passing requests from apache to mongrel. Does this sound correct ? I believe the Virtual Host is set up in Apache. One of my problems is I can''t find the httpd.conf file for
2012 Sep 24
3
List creation based on matrix
Hi guys, It would be great if you could help me with this one... I'm looking to create a script to convert a matrix of species abundance e.g: <http://r.789695.n4.nabble.com/file/n4643978/species_matrix.jpg> into two vectors e.g: <http://r.789695.n4.nabble.com/file/n4643978/communitylist.jpg> ---------------- If you feel there is no easy answer to this and that it would be
2010 Apr 13
0
dbFD computing distinct species wrong?
Hi everyone, I am working with the dbFD function of the FD package, and there's something funny happening with the value of sing.sp in the output. Basically, I have a species-function matrix and a community matrix. One site in particular has 6 species, 4 of which have identical functional coding. I thus expect nbsp = 6 and sing.sp = 2 for this site. However, nbsp = sing.sp = 6. This