search for: chipmaney

Displaying 15 results from an estimated 15 matches for "chipmaney".

2010 Feb 18
2
subset() for multiple values
This code works: subset(NativeDominant.df,!ID=="37-R17") This code does not: Tree.df<-subset(NativeDominant.df,!ID==c("37-R17","37-R18","10-R1","37-R21","37-R24","R7A-R1","3-R1","37-R16")) how do i get subset() to work on a range of values? -- View this message in context:
2010 Feb 18
2
Extracting values from a list
I have run a kruskal.test() using the by() function, which returns a list of results like the following (subset of results): Herb.df$ID: 4-2 Kruskal-Wallis chi-squared = 18.93, df = 7, p-value = 0.00841 -------------------------------------------------------------------- Herb.df$ID: 44-1 Kruskal-Wallis chi-squared = 4.43, df = 6, p-value = 0.6187 So then, how do extract a vector
2009 Aug 19
2
how do i vectorize relational queries in R
I am basically trying to append a value(vector) to one dataframe using a relational value from another dataframe. Obviously, I can use a loop to accomplish this. However, is there a way to vectorize it? Example: > data <- data.frame(c(1,1,1,2,2,2,3,3,3),rep(2,9)); names(data) <- > c("Sample","Score") > meta <-
2010 Aug 26
3
Non-standard sorts on vectors
I have a dataset I need to sort: test.df<-data.frame(Zone=c("Floodplain", "Lake", "Shoreline"),Cover=c(50,60,70)) However, I don't want it sorted ascending/descending but in an order that I define via a vector: sort.v<-data.frame(c("Lake","Shoreline","Floodplain")) I realize I could probably just create the vector of
2009 Sep 29
1
vectors levels are carried through to subsets...
I have a dataset. Initially, it has 25 levels for a certain factor, Description. However, I then subset it, because I am only interested in 2 of the 25 factors. When I subset it, I get the following. The vector lists only the two factors, yet there remain 25 levels: > Quadrats.df$Description [1] Emergent 25x75 Emergent 25x75 Emergent 25x75 Emergent 25x75 Emergent 25x75 Emergent 25x75
2011 Mar 29
2
List extraction
I have created a list of tables with the same columns but different number of row. Example (actual list has ~200 elements): > temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) > temp2<- data.frame(ID=c("Herb","Shrub", > "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) > L<-list(a=temp1,b=temp2) > L $a
2009 Sep 29
1
Interesting function in a function problem....
#I have these data. Basically, I want to run a tapply to calculate the mean and st. err. by factor. #The problem is, I want to add a finite correction to the variance prior to calculating the standard error. #Now I know I could just do this in 3/4 steps by calculating the var, applying the correction, then calculating the StErr. #However, I am trying to learn about functions and how they work. So
2009 Sep 29
1
axis scale issues....
I have read all the help on axis scales, which seems to be much harder to deal with than it should be, given how common the need to alter axes. Anyway....yeah, suppress the axis using yaxt then call and define the new scale using axis(). The problem is, this doesn't change the actual axis, only the text. Example: plot(1:length(TreeDensity.df$Description[which(TreeDensity.df$Description ==
2009 Jul 13
1
Help get this simple function to work...
I have a function (see below). This function has one object, ID. If I run the loops by themselves using a character value (ie,"VFFF1-7") instead of the function object, then the loops work fine. However, when I try to insert the character value via the function call, it doesn't work. I don't get an error, but the TotalCover.df dataframe does not update according to the loop
2010 Jul 29
2
Using '[' as a function
I am learning R, and instead of learning by rote, I am trying to better understand the language in order to improve my programming. So any "meta-information" on why the following code works would be greatly appreciated... I obtained this code to extract the first record from each of a series of vectors in a list: >example<- list(c(1,2),c(3,4),c(4,5)) [[1]] [1] 1 2 [[2]] [1] 3 4
2010 Jan 27
2
using functions with multiple arguments in the "apply" family
typically, the apply family wants you to use vectors to run functions on. However, I have a function, kruskal.test, that requires 2 arguments. kruskal.test(Herb.df$Score,Herb.df$Year) This easily computes the KW ANOVA statistic for any difference across years.... However, my data has multiple sites on which KW needs to be run... here's the data: Herb.df<-
2009 Oct 21
1
How do I vectorize this loop....
Basically I need to use the following data to calculate a squared error for each Sample based on the expected Survival for the zone. Basically, this code has Live/Dead for each sample, and I need to calculate the square error based on the Expected Mean (ie, Survival). The code looks up the expectation for each zone and applies for each sample in the zone using a loop: Data1 <-
2010 Feb 24
1
extracting results from wilcox_test (package::coin)
Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by() to group by site Output is a list: >Herb.KW Herb.df$ID: 10-1 Kruskal-Wallis rank sum test data: Indicator_Rating by Year Kruskal-Wallis chi-squared = 15.24, df = 7, p-value = 0.03302 ----------------------------------------------------------------------------------------------------- Herb.df$ID: 18-1
2007 Jul 16
0
Basic missing values question...
I am trying to run the power.t.test function to calculate sample size for a data frame of variances (i.e, 228 rows x 4 cols). Many of the fields are missing values, which crashes the function. I have tried na. options in the function, but the function doesn't recognize them. I have also tried an if-else loop to skip over fields with missing values. How can I deal with these missing
2009 Jul 13
2
Help me get this function to work...
I have a function (see below). This function has one object, ID. If I run the loops by itself using a character value (ie,"VFFF1-7"), then the loops work fine. However, when I try to insert the character value via the function call, it doesn't work. I don't get an error, but the TotalCover.df dataframe does not update according to the loop criteria. Any obvious problems that