similar to: Schmera: a question on R software

Displaying 20 results from an estimated 600 matches similar to: "Schmera: a question on R software"

2011 Apr 07
1
Assigning a larger number of levels to a factor that has fewer levels
Hello! I have larger and a smaller data frame with 1 factor in each - it's the same factor: large.frame<-data.frame(myfactor=LETTERS[1:10]) small.frame<-data.frame(myfactor=LETTERS[c(9,7,5,3,1)]) levels(large.frame$myfactor) levels(small.frame$myfactor) table(large.frame$myfactor) table(small.frame$myfactor) myfactor has 10 levels in large.frame and 5 levels in small.frame. All 5
2009 May 06
4
tapply changing order of factor levels?
Hi, Does tapply change the order when applied on a factor? Below is the code I tried. > mylevels<-c("IN0020020155","IN0019800021","IN0020020064") >
2012 Jan 18
1
drop rare factors
I have a data frame with some factor columns. I want to drop the rows with rare factor values (and remove the factor values from the factors). E.g., frame$MyFactor takes values A 1,000 times, B 2,000 times, C 30 times and D 4 times. I want to remove all rows which assume rare values (<1%), i.e., C and D. i.e., frame <- frame[[! (frame$MyFactor %in% c("A","B"))]] except
2010 Jul 05
2
repeated measures with missing data
Dear R help group, I am teaching myself linear mixed models with missing data since I would like to analyze a stats design with these kind of models. The textbook example is for the procedure "proc MIXED" in SAS, but I would like to know if there is an equivalent in R. This example only includes two time-measurements across subjects (a t-test "with missing values"), but I
2012 Mar 28
1
discrepancy between paired t test and glht on lme models
Hi folks, I am working with repeated measures data and I ran into issues where the paired t-test results did not match those obtained by employing glht() contrasts on a lme model. While the lme model itself appears to be fine, there seems to be some discrepancy with using glht() on the lme model (unless I am missing something here). I was wondering if someone could help identify the issue. On
2012 Nov 24
1
Adding a new variable to each element of a list
Hello, I have a list of data with multiple elements, and each element in the list has multiple variables in it. Here's an example: ### Make the fake data dv <- c(1,3,4,2,2,3,2,5,6,3,4,4,3,5,6) subject <- factor(c("s1","s1","s1","s2","s2","s2","s3","s3","s3",
2006 Apr 29
1
splitting and saving a large dataframe
Hi, I searched for this in the mailing list, but found no results. I have a large dataframe ( dim(mydata)= 1297059 16, object.size(mydata= 145280576) ) , and I want to perform some calculations which can be done by a factor's levels, say, mydata$myfactor. So what I want is to split this dataframe into nlevels(mydata$myfactor) = 80 levels. But I must do this efficiently, that is, I
2007 Dec 09
2
adjusting "levels" after subset a table
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071208/5409f1a7/attachment.pl
2011 Mar 30
2
summing values by week - based on daily dates - but with some dates missing
Dear everybody, I have the following challenge. I have a data set with 2 subgroups, dates (days), and corresponding values (see example code below). Within each subgroup: I need to aggregate (sum) the values by week - for weeks that start on a Monday (for example, 2008-12-29 was a Monday). I find it difficult because I have missing dates in my data - so that sometimes I don't even have the
2006 May 24
3
How to make attributes persist after indexing?
Dear All! For descriptive purposes I would like to add attributes to objects. These attributes should be kept, even if by indexing only part of the object is used. I noted that some attributes like levels and class of a factor exist also after indexing, while others, like comment or label vanish. Is there a way to make an arbitrary attribute to be kept after indexing? This would be especially
2011 Nov 10
1
Errors in SIAR
Help! model1 <- siarmcmcdirichletv4(data, source, tef, concdep=0, 500000, 50000) Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow = (siardata$iterations - : invalid 'ncol' value (too large or NA) In addition: Warning message: In Ops.ordered((numsources + numiso), numgroups) : '*' is not meaningful for ordered factors Previous message, but more
2009 Mar 03
1
repeated measures anova, sphericity, epsilon, etc
I have 3 questions (below). Background: I am teaching an introductory statistics course in which we are covering (among other things) repeated measures anova. This time around teaching it, we are using R for all of our computations. We are starting by covering the univariate approach to repeated measures anova. Doing a basic repeated measures anova (univariate approach) using aov() seems
2008 Aug 29
1
R graphical question
I'm trying to create a graph using plot() with an axis that I essentially want to plot the categories in the reverse alphanumeric order - opposite of the typical R fashion. Is there a function to do this? In other words, I have categories "a", "c", "g", "z" which is the order they'll be plotted, but I want to plot them as "z",
2005 Apr 26
2
Fresh Dovecot Install
Working on an RH9 box. Did not use yum. Downloaded the "dovecot-stable-latest.tar.gz". Uncompressed it, downloaded and installed gcc. Ran the following: ./configure make sudo make install Seemed to have done its thing. I'll admit I am not well versed in using "make" or compiling anything. When I install I usually use yum on fedora machines. This one being an RH9 machine
2003 Jun 27
3
dropping factor levels in subset
Dear all, I've taken a subset of data from a data frame using crb<-subset(all.raw, creek %in% c("CR") & year %in% c(2000,2001) & substrate %in% ("b")) this works fine, except that all of the original factor levels are maintained. This results in NA's for these empty levels when I try to do summaries based on factors using by(). Is there a simple way to drop
2003 Jun 04
2
convert factor to numeric
Hi R-experts! Every once in a while I need to convert a factor to a vector of numeric values. as.numeric(myfactor) of course returns a nice numeric vector of the indexes of the levels which is usually not what I had in mind: > v <- c(25, 3.78, 16.5, 37, 109) > f <- factor(v) > f [1] 25 3.78 16.5 37 109 Levels: 3.78 16.5 25 37 109 > as.numeric(f) [1] 3 1 2 4 5 > What I
2011 Mar 16
2
Numeric vector converted mysteriously to characters in data frame?
Dear R Help, I would be very grateful if somebody could explain why this is happening. I am trying to plot a lattice barchart of a vector of numbers with age bandings that I have brought together into a data frame. When I plot the variables in their raw vector form, it works. When I try to plot them in the df, R labels the numeric axis with default factor values and treats the numeric vector
2003 Nov 13
5
xlims of barplot
I would like to create a family of barplots with the same xlimits. Is there a way to "read" the xlimits from the first graph so I can apply it to the subsequent ones? I have tried just taking the min and max of the x data and the plot doesn't show. cheers [[alternative HTML version deleted]]
2006 Jan 30
2
Type II SS for fixed-effect in mixed model
Hi In mixed-model with lme() How can I obtain Type II SS or Type III SS for fixed effect? Thanks Julien
2003 Nov 21
3
what does this mean in R-1.8.1 release notes?
what does this mean in R-1.8.1 release notes? o median() no longer `works' for odd-length factor variables.