search for: vecotr

Displaying 19 results from an estimated 19 matches for "vecotr".

Did you mean: vecot
2008 Nov 25
2
creating a new vecotr in a for loop
..._VAC_FEET$TAZ==Loc_Mod_TAZ,2] #Creates new vector based on adaquate vacancy in the TAZ and the development to be located Newcands=subset(Loc_Mod_TAZ, TAZDetermine_FEET>=Dev_Size) } Thanks for the help Cheers, JR -- View this message in context: http://www.nabble.com/creating-a-new-vecotr-in-a-for-loop-tp20691663p20691663.html Sent from the R help mailing list archive at Nabble.com.
2016 Apr 07
4
simple question on data frames assignment
...= c("blue", "red", "green", "blue", "orange")) for (i in 1:nrow(colordata)){ colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) } which works, but I don't want to use the for loop I want to "vecotrize" this. How would this be implemented? [[alternative HTML version deleted]]
2016 Apr 07
0
simple question on data frames assignment
...red", > "green", "blue", "orange")) > for (i in 1:nrow(colordata)){ > colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) > } > > which works, but I don't want to use the for loop I want to "vecotrize" > this. How would this be implemented? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE...
2014 Nov 14
3
Cómo aplicar weights a las observaciones en un GLM binomial
...eights =~ tus.pesos, data = tus.datos) # en caso de una reg logística modelo <- svyglm(respuesta~ var1 + var2, family = binomial, design = ddatos) Después si se proseguir con la realización del modelo, pero lo que no sé es cómo pondero la muestra, es decir si ese "tus.pesos" es una vecotr, osea una nueva variable en mi dataset, qué valores debe contener. Perdonad las molestias, Un saludo y gracias Isa [[alternative HTML version deleted]]
2016 Apr 07
2
simple question on data frames assignment
...uot;green", "blue", "orange")) >> for (i in 1:nrow(colordata)){ >> ? ?colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) >> } >> >> which works,? but I don't want to use the for loop I want to "vecotrize" >> this.? How would this be implemented? >> >> ? ? ? ? [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman...
2010 Mar 15
1
rbind, data.frame, classes
Hi, This has bugged me for a bit. First question is how to keep classes with rbind, and second question is how to properly return vecotrs instead of lists after turning an rbind of lists into a data.frame list1=list(a=2, b=as.Date("20090102", format="%Y%m%d")) list2=list(a=2, b=as.Date("20090102", format="%Y%m%d")) rbind(list1, list2) #this loses the posixct class. My first question is is th...
2009 Jan 14
2
Vectorization of three embedded loops
...ntel Core 2 Duo, Memory 2 GB 667 MHZ DDR2 SDRAM). I used for the heart of the script three embedded loops. This makes it especially for huge datasets very slow. For a datamatrix of 1853*1853 and the selection of 556 samples needed computation time of more than 24 hours. I did some research on vecotrization, but I could not figure out how to do it better/faster. Which ways are there to replace the time consuming loops? Here are some information: # val.n<-24; # start.b<-matrix(nrow=1812, ncol=20); # val is a vector of the rownames of 22 in an earlier step chosen extrem samples; # e...
2016 Apr 07
4
simple question on data frames assignment
...t;green", "blue", "orange")) >> for (i in 1:nrow(colordata)){ >> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) >> } >> >> which works, but I don't want to use the for loop I want to "vecotrize" >> this. How would this be implemented? >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman...
2016 Apr 08
0
simple question on data frames assignment
...t;red", > "green", "blue", "orange")) > for (i in 1:nrow(colordata)){ > colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) > } > > which works, but I don't want to use the for loop I want to "vecotrize" > this. How would this be implemented? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE...
2016 Apr 07
2
simple question on data frames assignment
...t;green", "blue", "orange")) >> for (i in 1:nrow(colordata)){ >> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) >> } >> >> which works, but I don't want to use the for loop I want to "vecotrize" >> this. How would this be implemented? >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman...
2016 Apr 07
2
simple question on data frames assignment
...e")) >>>> for (i in 1:nrow(colordata)){ >>>> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) >>>> } >>>> >>>> which works, but I don't want to use the for loop I want to "vecotrize" >>>> this. How would this be implemented? >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ------------------------------ >>>> >>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE...
2016 Apr 07
0
simple question on data frames assignment
...ot;, "orange")) >>> for (i in 1:nrow(colordata)){ >>> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", >1, 0) >>> } >>> >>> which works, but I don't want to use the for loop I want to >"vecotrize" >>> this. How would this be implemented? >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>...
2003 Jul 01
1
Creating a loop that works....
...t;bio" as bio<-matrix(NA, ncol=9, nrow=366) but that doesn't help either. Perhaps my rbind at the end of the file is incorrect? I think maybe I'm getting mixed up between calculating vectors and values-- should I be specifying [i] for everything below where I am now specifying vecotrs? + #W<-Wo + + C<- p*CA*(W^CB)*((comp[,3]^Xc)*(exp(Xc*(1-comp[,3]))))*Pc + + ASMR<- (ACT*RA*(W^(RB))*((comp[,4]^Xa)*(exp(Xa*(1-comp[,4]))))) + + SMR<- (ASMR/ACT) + + A<- (ASMR-SMR) + + F<- (FA*(comp[,2]^FB)*(exp(FG*p))*C) + + U<- (UA*(comp[,2]^UB)*(exp(UG*p))*(C-F)) +...
2016 Apr 07
0
simple question on data frames assignment
...t; for (i in 1:nrow(colordata)){ >>>>> colordata$response[i] <- ifelse(colordata[i,"color"] == >"blue", 1, 0) >>>>> } >>>>> >>>>> which works, but I don't want to use the for loop I want to >"vecotrize" >>>>> this. How would this be implemented? >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> ------------------------------ >>>>> >>>>> R-help at r-project.org ma...
2016 Apr 08
0
simple question on data frames assignment
...", "orange")) > >> for (i in 1:nrow(colordata)){ > >> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, 0) > >> } > >> > >> which works, but I don't want to use the for loop I want to "vecotrize" > >> this. How would this be implemented? > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > &g...
2010 Nov 15
1
Aggregate on identical link attributes
...Node<-c(rev(1:20),22) Volume<-c(rep(100,20),200) ClassCode=c(rep("Local",20),rep("Freeway",1)) #Create data frame with test data EmmeData..<-data.frame(TNode=TNode,FNode=FNode,Volume=Volume,ClassCode=ClassCode) #Create list to store results LinkSum_<-list() #Create vecotrs to establish loops TNodes<-unique(EmmeData..$TNode) FNodes<-unique(EmmeData..$FNode) for(tn in TNodes){ for(fn in FNodes){ TF<-EmmeData..[EmmeData..$TNode==tn & EmmeData..$FNode==fn,] FT<-EmmeData..[EmmeData..$TNode==fn & EmmeData..$FNode==tn,]...
2013 Apr 29
3
all.vars for nested expressions
Dear R fellows, Assume I define a <- expression(fn+tp) sen <- expression(tp/a) Now I'd like to know, which variables are necessary for calculating sen all.vars(sen) This results in a vector c(tp,a). But I'd like all.vars to evaluate the sen-object down to the ground level, which would result in a vector c(tp,fn) (because a was defined as fn+tp). In other words, I'd like
2008 Jul 27
4
product of successive rows
Hi everyone, I want to perform an operation on a matrx that outputs the product of successive pairs of rows. For example: calculating the product between rows 1 & 2; 3 & 4; 5 & 6...etc. Does anyone know of any readily available functions that can do this? Thanks, rcoder -- View this message in context: http://www.nabble.com/product-of-successive-rows-tp18681259p18681259.html
2016 Apr 08
0
simple question on data frames assignment
...t;, "blue", "orange")) for (i in 1:nrow(colordata)){ > >> colordata$response[i] <- ifelse(colordata[i,"color"] == "blue", 1, > >> 0) } > >> > >> which works, but I don't want to use the for loop I want to "vecotrize" > >> this. How would this be implemented? > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org<mailto:R-help at r-project.org> mailing list -...