similar to: generating a data frame with a subset from another data frame

Displaying 20 results from an estimated 600 matches similar to: "generating a data frame with a subset from another data frame"

2007 Aug 31
1
Strange behavior using subset
Dear R Gurus, Let's get the technical details out of the way first: Computer: 1.83 GHz MacBook R version 2.5.1 I have a data set that contains the following variables: site, species, total.vines. I need to partition the main data set by site, the further select only those species that occurred at each site. When I select by site (site.name<-subset(data frame,Site=="Site
2007 Jul 31
2
choosing between Poisson regression models: no interactions vs. interactions
R gurus, I'm working on data analysis for a small project. My response variable is total vines per tree (median = 0, mean = 1.65, min = 0, max = 24). My predictors are two categorical variables (four sites and four species) and one continuous (tree diameter at breast height (DBH)). The main question I'm attempting to answer is whether or not the species identity of a tree has
2007 Jul 02
4
Extracting sums for individual factors in data frames
I have a data frame with two columns, one of which is a factor (Species) and the other is numeric (BA, which stands for basal area). Here's a sample: Species BA ACSA 55.7632696 FRAM 122.9933524 ACSA 67.54424205 ACSA 89.22123136 ACSA 82.46680716 ACSA 22.46238747 ACSA 19.94911335 ACSA 20.42035225 ACSA 19.00663555 ACSA 21.67698931 ACSA 57.80530483 ACSA 30.31636911 Dead 43.98229715 Dead
2010 Jan 07
1
LD50 and SE in GLMM (lmer)
Hi All! I am desperately needing some help figuring out how to calculate LD50 with a GLMM (probit link) or, more importantly, the standard error of the LD50. I conducted a cold temperature experiment and am trying to assess after how long 50% of the insects had died (I had 3 different instars (non significant fixed effect) and several different blocks (I did 4 replicates at a time)=
2006 Mar 26
1
Newbie clustering/classification question
My laboratory is measuring the abundance of various proteins in the blood from either healthy individuals or from individuals with various diseases. I would like to determine which proteins, if any, have significantly different abundances between the healthy and diseased individuals. Currently, one of my colleagues is performing an ANOVA on each protein with MS Excel. I would like to analyze
2011 Feb 17
1
cv.glmnet errors
Hi, I am trying to do multinomial regression using the glmnet package, but the following gives me an error (for no reason apparent to me): library(glmnet) cv.glmnet(x=matrix(c(1,2,3,4,5,6,1,2,3,4,5,6), nrow=6),y=as.factor(c(1,2,1,2,3,3)),family='multinomial',alpha=0.5, nfolds=2) The error i get is: Error in if (outlist$msg != "Unknown error") return(outlist) : argument is of
2012 Apr 01
1
indexing in a function doesn't work?
Hello, I've written a small function that's supposed to save me some time, and it's ending up killing it- the intention is to iteratively subset a dataset fram on framevec, fit a model (either lm or nls depending on type) and return the r2 or AIC from the model, respectively. Although as far as I can tell in my code the plots are dependent on the fit of the model to the data and the
2011 Oct 27
1
Question about .Fortran in glmnet package
Hi, My apologies for asking this question, but could not find the answer elsewhere. I understand the glmnet package uses Fortran code. For example, the lognet.R file includes the lines of code shown below. But how can I see the Fortran code that is being referenced in the code below? Is that provided somewhere in the package source code? .Fortran("lognet",
2012 Jun 22
4
Search list of elements for a specific pattern
Hi, I have a list of mutations, called "mutList", of the form: > head(mutList) Alu 1 AluJ 2 AluJ/F(R)AM 3 AluJ/FLAM 4 AluJ/FRAM 5 AluJ/monomer 6 AluJb It contains about 500 elements and not all of them contain the sequence "Alu". I tried using this code: Alu<-mutList[which(grep("Alu",mutList)==1)] But that simply returned
2011 Jul 12
3
Reorganize data fram
Hi, I have a data frame of about 700 000 rows which look something like this: Date Temperature Category 2007102 16 A 2007102 17 B 2007102 18 C but need it to be: Date TemperatureA TemperatureB TemperatureC 2007102 16 17 18 Any suggestions? /Angelica -- View this message
2006 Apr 26
2
help in R
Hi, I cant understand where I am going wrong.Below is my code.I would really appreciate your help. Thanks. > genfile<-read.table("c:/tina/phd/bs871/hw/genfile.txt",skip=1) > > #read in SNP data > snp.dat <- as.matrix(genfile) > snp.name <- scan("c:/tina/phd/bs871/hw/genfile.txt",nline=1,what="character") Read 100 items
2010 Dec 31
2
Class "coef.mer" into a data.frame?
Hello, Could somebody please tell me what am I doing wrong in following? I try extract coefficients (using arm-package) from the lmer frunction, but I get the following warning: a<-data.frame(coef(res)) Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class "coef.mer" into a data.fram I think I have done it before
2010 Jul 19
3
specifying column names in a vector of characters and the use?
Hi, What I would like to do is have a data.frame with column names and have these column names stored as strings in another vector. Then I would like to be able to access the data.fram columns via referencing the vector of names. The code below shows the last few executions that failed to retrieve the values for column named X1. Seth >
2008 Jul 02
2
Accessing a field in a data fram
raw <- read.csv(file=filename, head=TRUE,sep=",") I've read in a csv file, and I'm looking to access a column whose name is held in a string. For example, I want to access raw$one or raw$two, but this will depending on the string. Let's say that the string is decision<-"one". How would I access raw$one? The following doesn't work:
2012 Aug 06
2
Identify points that lie within polygon
I have a complex 2D polygon with thousands of vertices, and I'd like to be able to identify points from a large set contained within the polygon, and was wondering if there might be an efficient way of doing this? Any advice would be useful! Here is a small example of what I mean: # make polygon v1<-c(0,1,1,2,1,3,6,7) v2<-c(1,3,3,5,6,7,8,9) plot(v1, v2, type = "n" )
2005 Feb 16
0
Watson Singapore Cares for Singaporean with Biotechnology-revised
Dear Valued Watsons Singapore Customers, Watsons Singapore brings you the latest in Beauty Care with Biotechnology in all 72 Watsons Outlets throughout Singapore. Try! Believe the miraculous effects of Vitasence Biotechnology! Vitasence Biotechnology : A. Amino Acid Facial Cleansing Mousse Skin friendly cleansing agents based on olive oil and amino acids are used to provide effective
2012 May 07
2
how to deduplicate records, e.g. using melt() and cast()
Esteemed UseRs, This must be embarrassingly trivial to achieve with e.g., melt() and cast(): deduplicating records ("pw.X" in example) for a given set of responses ("cond.Y" in example). Hopefully the runnable example shows clearly what i have and what i'm trying to convert it to. But i'm just not getting it, ?cast that is! So i'd really appreciate some ones
2007 Jun 04
0
Auto VIN Decoder - What Do Those Letters & Numbers Mean?
Auto VIN Decoder - What Do Those Letters & Numbers Mean? An Auto VIN Decoder breaks down the unique alphanumeric sequence known as a Vehicle Identification Number, which is a car''s fingerprint. http://2site.com/nrbpec ATA vs SATA The performance of computer systems has been steadily increasing as faster processors, memory, and video cards are continuously being developed. The
2008 May 07
3
predict lmer
Hi, I am using lmer to analyze habitat selection in wolverines using the following model: (me.fit.of <- lmer(USED~1+STEP+ALT+ALT2+relM+relM:ALT+(1|ID)+(1|ID:TRKPT2),data=vdata, control=list(usePQL=TRUE),family=poisson,method="Laplace")) Here, the habitat selection is calaculated using a so-called discrete choice model where each used location has a certain number of alternatives
2006 Apr 06
1
reshape question
Hi, I have a data fram like this: date column1 column2 column3 value1 value2 value3 1-1 A B C 10 5 2 2-1 A B D 5 2 0 3-1 A B E 17 10 7 How can I reshape it to: date column1 column2 column3 v x 1-1 A B C value1 10 1-1 A B C value2 5 1-1 A B C value3 2 2-1 A B D value1 5 2-1 A B D value2 2 2-1 A B D value3 0 3-1 A B E value1 17 3-1 A B E value2 10 3-1 A B E value3 7 Thx! Regards, Richard