similar to: Remove empty levels in subset

Displaying 20 results from an estimated 20000 matches similar to: "Remove empty levels in subset"

2003 Mar 21
2
Trying to make a nested lme analysis
Hi, I''m trying to understand the lme output and procedure. I''m using the Crawley''s book. I''m try to analyse the rats example take from Sokal and Rohlf (1995). I make a nested analysis using aov following the book. > summary(rats) Glycogen Treatment Rat Liver Min. :125.0 Min. :1 Min. :1.0 Min. :1 1st Qu.:135.8
2008 Nov 10
2
as.Data with minutes resolution
Hi, I have a vetor os dates with day and hour:minutes. > time1 <- c("03/08/08-11:00","03/08/08-11:10") > time1 <- as.Date(time1,"%d/%m/%y-%R") > summary(time1) Min. 1st Qu. Median Mean 3rd Qu. Max. "2008-08-03" "2008-08-03" "2008-08-03" "2008-08-03" "2008-08-03"
2005 Nov 16
3
Difficulties with for() {while(){}}
Hi, I have the follow function: function() { ## Init of function ... for(i in test) { ... while(j <= test2) { ... } } } The problem is that sometimes, naturally, the while is not possible to be resolved, and so the program abort. In this case I need that program return to the init of function and run again. How I can make this? Abort the while, abort the for
2005 Oct 24
3
lme and lmer syntax
Hi, I have this: lme(y~x1+x2,random=~1|x1/x2) How to make this random effect using lmer? I try this: lmer(y~x1+x2+(1|x1/x2) But it dont work. Any idea? Thanks Ronaldo -- System halted! -- |> // | \\ [***********************************] | ( ?? ?? ) [Ronaldo Reis J??nior ] |> V [UFV/DBA-Entomologia ] | / \ [36570-000 Vi??osa -
2007 Oct 05
3
help in substitute function
Hi, I try to use a substitute function to generalise a equation. I have this: expression(1+2*pred+3*lat) I need to define the equation in function of x1 and x2 variables. Also I try to define who is x1 and x2. I try this: X1 <- "pred" X2 <- "lat" Now I need substitute pred and lat in equation by x1 and x2 defined on X1 and X2 above, I try this way: >
2007 Dec 13
4
Very simple question on plot
Hi, I try to make a plot like this: Y | | | o | o o | o o | o o |o o o |-------------------------------- 0 10 20 30 40 50 60 70 80 90 100 (A) 100 90 80 70 60 50 40 30 20 10 0 (B) or B 100 90 80 70 60 50 40 30 20 10 0 Y |-------------------------------- | | o
2009 Sep 01
2
Simple question about data.frame reduction
Hi, this is a simple question I have this data.frame: > test <- data.frame(var1=c(1,1,1,1,1,1),var2=c("a","a","b","c","d","e"),var3=c("a1","a1","b1","a1","c1","d1")) > test var1 var2 var3 1 1 a a1 2 1 a a1 3 1 b b1 4 1 c a1 5 1
2008 Feb 20
2
factors ordered by mean
Hi, How to order the levels os factor not by alphabetic order but by mean of Y. Somethink like this: I have this alphabetic order: > levels(pH) [1] "alto" "baixo" "medio" the order by mean os yvar is: > sort(tapply(Riqueza,pH,mean)) baixo medio alto 11.56667 20.00000 26.80000 How to make the levels of pH ordered by this mean to the result to
2004 Aug 25
3
integrate function
Is possible to integrate this diferential equation: dN/dt = Nr(1-(N/K)) in R using the integrate() function? Or any other diferential equation? If yes, how? If no, anybody know any software on linux that make this? Inte Ronaldo -- O problema de ter os dois p??s bem firmes no ch??o ?? que voc?? n??o vai conseguir tirar as cal??as. --An??nimo -- |> // | \\
2008 Aug 01
2
How to get the p-value from lmer on a longitudinal analysis
Hi, I have a modelo like this: Yvar <- c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4) TIME <- 4:22 ID <- rep("PlotA",19) m <- lmer(Yvar~TIME+(TIME|ID),family=poisson) anova(m) summary(m) How to get the p-value for this case? Thanks Ronaldo -- Just because you're paranoid doesn't mean they AREN'T after you. -- > Prof. Ronaldo Reis J?nior |
2007 Aug 24
3
It is possible to use a Shell command inside a R script?
Hi, It is possible to use a shell command inside a R script? I'm write a R script and I like to put somes shell commands inside to R. Somethink like: convert fig01.png fig01.xpm or sed ..., etc. It is possible? How? Thanks Ronaldo -- Acalme-se, s??o somente 0's e 1's -- > Prof. Ronaldo Reis J?nior | .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Ecologia | : :' :
2007 Apr 23
1
help on xyplot and curves
Hi, I need to add some different curves to a each panel in a xyplot. I have a old function to make this using panel.number, like this: panel=function(x,y,panel.number,...){ panel.xyplot(x,y,...) if(panel.number==1){ panel.curve(-655.8689+769.1589*log(5)+64.7981*log(x)-206.4475*log(5)^2) } if(panel.number==2){
2008 Sep 22
1
change the panel name in xyplot
Hi, I try to change the panel name in a xyplot without success. Look this example from xyplot manual: xyplot(Murder ~ Population | state.region,data=states) The panel title are: Northeast, South, North Central, West, that are factor from state.region. I need do change some names and, for example, put some of these in italic. I dont find how change this. I looking for this in Deepayan
2002 Jun 21
3
generating points over a function, its possible???
Hi, I have a new (for me) situation. I have a function for one linear model: y = 9.7909-0.035*x I have the variance of system var = 13.01403 Is possible to create a random vector points of Y (simulating the real data) over this curve using the function and the variance? I need this to a discipline. I have this: | \ | \ -> y = 9.7909-0.035*x and var = 13.014 | \ | \ | \ | \
2003 Oct 14
1
[OFF] Dataset for extra Crawley Chapter
Hi, anybody have the dataset used in Gamma Errors chapter of the Crawley's books (An Introduction to Data Analysis using S-Plus). specifically the functionalresponse and the Density datasets. Thanks Ronaldo -- For every problem there is one solution which is simple, neat, and wrong. -- H. L. Mencken -- |> // | \\ [***********************************] | ( ? ? ) [Ronaldo Reis
2006 Sep 18
2
problem in font
Hi, after a debian upgrade my dev.copy2eps dont work anymore. I have this message: Error in matchFont(postscriptFonts(family)[[1]], old$encoding) : unknown font I try to change the font family in my .Rprofile: setHook(packageEvent("graphics", "onLoad"), function(...) { grDevices::ps.options(family="ComputerModern") } ) But it no fix
2005 Sep 09
2
best way to fit a model
Hi, I have some data that have this behaviour: | |******* | * | * | * | * |---------------- What is the best and simpler way to fit this in R? Thanks Ronaldo -- Ela pilotava um Continenal 2001 com igni????o autom??tica Magiclic... -- |> // | \\ [***********************************] | ( ?? ?? ) [Ronaldo Reis J??nior ] |>
2003 Feb 04
2
testing slope
Hi all, I try to test a linear slope using offset. I have: > m2 <- glm(Y~X*V) > summary(m2) Call: glm(formula = Y ~ X * V) Deviance Residuals: Min 1Q Median 3Q Max -2.01688 -0.56028 0.05224 0.53213 3.60216 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.3673 0.8476 1.613 0.119788 X
2006 Mar 15
1
manipulating weeks dates
Hi, I have these vectors: > WEEK <- rep(c(1:52),2) > YEAR <- rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- "Realmente minha cidade e muito facultativa" --Elivelton, ao rep?rter da Jovem Pan que falava das muitas
2009 Nov 25
1
Sampling dataframe
Hi, I have a table like that: > datatest var1 var2 var3 1 1 1 1 2 3 1 2 3 8 1 3 4 6 1 4 5 10 1 5 6 2 2 1 7 4 2 2 8 6 2 3 9 8 2 4 10 10 2 5 I need to create another table based on that with the rules: take a random sample by var2==1 (2 sample rows for example): var1 var2 var3 1 1