search for: newfactor

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

2011 May 19
1
Creating a "shifted" month (one that starts not on the first of each month but on another date)
...01-01"), length = 92, by = "day")) (mydf) ### Creating a new variable that has one value before ### the 20th of each month and next value after it mydf$daynum<-as.numeric(format(mydate,"%d")) library(zoo) mydf$yearmon<-as.yearmon(mydf$mydate) (mydf); str(mydf) mydf$newfactor<-NA for(i in unique(mydf$yearmon)){ # looping through "yearmon" (important because true data has many years of data) tempdf<-mydf[mydf$yearmon == i,] which.month<-which(unique(mydf$yearmon)==i) tempdf$newfactor[tempdf$daynum<20]<-which.month tempdf$newfactor[tempdf$dayn...
2008 May 19
2
From strings to numbers
Dear all, I would like to know if there is an easy to transform a vector of strings to a vector of integers. Ex: ("ab","ab","bb","cat","cat","ab") will be (1, 1, 2, 3, 3, 1) Thx, Naira -- View this message in context: http://www.nabble.com/From-strings-to-numbers-tp17315179p17315179.html Sent from the R help mailing list archive at
2006 Oct 22
1
how to convert multiple dummy variables to 1 factor variable?
Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui
2017 Jul 30
1
Add Anova statistics in each figure
...eriod1, y=mean, colour=Group, group=Group)) gp<-gp + geom_line(aes(linetype=Group), size=.6) + geom_point(aes(shape=Group), size=3) + geom_errorbar(aes(ymax=mean+se, ymin=mean-se), width=.1) gp+facet_grid(.~variable) ###two way anova interactions analysis # since I do have long$newFactor<-paste(long$Sites,long$variable) models <- dlply(long, "newFactor", function(df) lm(value ~ Group*Period, data = long)) summary(models) But I could not add the information of the interaction (F and its P values) in each above figures. Would you mind to hep me. It will be high...
2009 Dec 31
1
xyplot - help with multiple Y's vs. X of a member data in multiple panels
Dear R experts, Wish you all a HAPPY NEW YEAR! How do I go about plotting (using lattice) overlays of an ID (group=ID) observed, fitted data in each panel of a multiple panel plot (each panel identified by DS1 + DS2 + DS3)? "x" variable is X1 in the accompanying section of a dataset. each individual is identified by color and Y's are identified by "pch" or "lty".
2004 Mar 16
0
VS: Documentation on how to put classes and methods in packages with namespace?
...[121] "nameToVertexIndex" "newBlock" [123] "newBlockEdge" "newDefaultModelObject" [125] "newDefaultTestObject" "newFactor" [127] "newFactorEdge" "newVertex" [129] "newVertexEdge" "NodeAncestors" [131] "NodeAncestors<-"...
2004 Mar 16
2
Documentation on how to put classes and methods in packages with namespace?
Documentation on how to put classes and methods in packages with namespace? How should I define my classes and methods in "dynamicGraph"??? (That is - Can some one point me to the documentation on how to put classes and methods in packages with a namespace? ) Currently it is done by the code below. This gives problems, when a workspace with a "dynmaicGraph" is
2011 Mar 16
0
Comparing parts of strings
Hi, I have a vector of strings (categories), each element of which can be uniquely found in each element of a much longer vector of about 30 or so differeint factors. I would like to define another factor variable (drawn from NewFactorListaccording to which string from "categories" is found in the longer string of factors. Then I'd do it again, with another set of categories, and make a table based on the new factors. The last part is easy, but I've never had luck with string manipulation in R. for(j in 1:lengt...
2004 Mar 16
1
SV: Documentation on how to put classes and methods in packageswith namespace?
Re. the Kings Quest game called R, Inspired by the "stats4" of R-1.9.0 (alpha of 2004-03-15) I moved the body af my function ".onLoad.dynamicGraph" to the end of ".../dynamicGraph/R/dynamicGraph" (replacing "library(methods)" by "require(methods)"). The secound run, with [Previously saved workspace restored], produces the same result as in