search for: subset1

Displaying 9 results from an estimated 9 matches for "subset1".

Did you mean: subset
2010 Nov 18
3
problems subsetting
...n worked to my problem: I have a data frame that I get from a csv: summarystats<-as.data.frame(read.csv(file=f_summary)); where I have the columns Dataset, Class, Type, Category,.. Problem1: I want to find a subset of this frame, based on values in multiple columns What I do currently is: subset1 <- summarystats subset1<-subset1[subset1$Class == 1,] subset1<-subset1[subset1$Type == 1,] subset1<-subset1[subset1$Category == 1,] Now, this works, but is UGLY! I tried using "&&" or "&" , for isntance : subset1<-subset1[ (subset1$Class == 1)&&a...
2010 Feb 17
2
Is the aggregate function the best way to do this?
Hi, I''m having a dataframe ''Subset1'' with a number of factor variables and 160 numerical variables Now I want to make sums for all rows that have the same values for the different factor variables, except for the factor variables: VAR1,VAR2,VAR3 who may have the same values. With the formula given below this works great, b...
2012 Apr 21
2
using "factor" to eliminate unused levels without dropping other variables
...emingly simple problem with no success. I'm hoping that one or some of you can help. Here is the code I am trying to use: #importing data data.file <-read.csv("/file/location", header=TRUE, sep = ",") #selecting a subset of data based on variable "Sample" data.subset1 <- subset(data.file, subset=(Sample !='sample_x' & Sample !='sample_y')). **This leaves me a data file that has 8 levels of the variable "Sample" and 2 empty levels that correspond to sample_x and sample_y. I need to get rid of these two levels for plotting purpos...
2011 Feb 24
1
Creating objects (data.frames) with names stored in character vector
...to give the data.frames descriptive names which I have stored in a character vector. My original thought was that I want the subsets to show up as individual objects, but haveing them stored in a list is fine (maybe better). I can create a list of subsetted data.frames like this: >Lst = list(subset1 = (subset (blablabla)), subset2 = (subset(blabla))) but I have to provide the component names (subset1, subset2) manually. I would like to pull the component names from an existing character vector, but so far my attempts have failed. Any advice is appreciated, even if the advice is "don'...
2009 Sep 13
1
Manage an unknown and variable number of data frames
...st)],CutList,SIMPLIFY=FALSE) CutTable = as.data.frame(table(CutResults)) CutResultsDF = as.data.frame(CutResults) head(CutResultsDF, n=15) dat$aRange = CutResultsDF$a dat$bRange = CutResultsDF$b head(dat, 15) # I don't want to do the following as it doesn't # get managed automatically. Subset1 = subset(subset(dat, aRange==CutTable$a[1]), bRange==CutTable$b[1])[1:2] Subset2 = subset(subset(dat, aRange==CutTable$a[2]), bRange==CutTable$b[2])[1:2] Subset3 = subset(subset(dat, aRange==CutTable$a[3]), bRange==CutTable$b[3])[1:2] Subset4 = subset(subset(dat, aRange==CutTable$a[4]), bRange==Cut...
2007 Dec 29
1
COMPAR.GEE error with logistic model
...value very close to 1. estimates diverging; iteration terminated. In addition: Warning message: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, : algorithm did not converge" The input is the following model: compar.gee(RESPONSE ~ VAR1 + VAR2 + VAR3, data = subset1, family = "binomial", phy = prunedtree1) I have set all of the categorical data as factors and designated the family as "binomial". I don't know what else to do and the error message is not clear to me. If anyone can interpret this error message and/or knows how to run a co...
2004 Dec 14
1
Multiple options for a package
...ion("par") I was aking myselft what would be the "better" strategy to handle a bunch of options for a package. I ended up with the idea of storing a list, as my options would also be classified, with something like: -- MyPkgOptions = list(set1=list(par1=1,par2=2),set2=list(subset1=list(par1=11,par2=22),subset2=list(par1=111,par2=222))) options(PkgName=MyPkgOptions) -- Then, to make easier the access to an element, I tweaked a little bit getOption, with the following version: -- getOption <- function(x,...) { op = options(x)[[1]] if (length(list(...))>0) op &lt...
2007 Dec 20
1
custom subset method / handling columns selection as logic in '...' parameter
...ale Case 0.10 P Female Control 0.41 Q Female Case 0.16 R Male Control 0.72 S Male Case 0.17 T Female Case 0.74 U Male Control 0.35 V Female Control 0.77 W Male Control 0.27 X Male Control 0.98 Y Female Case 0.94 Z Female Case 0.32 # now the sample use > (subset1 =subset(expressionSet,sex="Male",type="Control")) 7 columns selected (C F J R U W X) ExpressionSet (storageMode: lockedEnvironment) assayData: 500 features, 7 samples element names: exprs, se.exprs phenoData sampleNames: C, F, ..., X (7 total) varLabels and varMetadata de...
2009 Nov 22
4
Do you keep an archive of "useful" R code? and if so - how?
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091122/430e3297/attachment-0001.pl>