Displaying 19 results from an estimated 19 matches for "vecotrize".
Did you mean:
fvectorize
2008 Nov 25
2
creating a new vecotr in a for loop
I have consulted the intro and nabble but have not found an answer to what
should be a simple question, here goes:
I am doing a crosscheck of a data frame and pulling out a single value based
on an inputted value ie based on x i will select y, or if x =2 then my code
returns 7.
x y
1 4
2 7
3 10
4 2
My code currently iterates through for as many times as the length of the x
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 do...
2014 Nov 14
3
Cómo aplicar weights a las observaciones en un GLM binomial
Gracias por la ayuda Jose Luis. pero o no te he entendido bien o mi duda es
tan sencilla que no me he explicado.
SI yo tampoco he entendido mal tu explicación, mi problema es cómo obtengo
ese "tus.pesos" para introducir, por ejemplo, en la función:
library(survey)
# objeto del diseño muestral
ddatos <- svydesign(id=~1, weights =~ tus.pesos, data = tus.datos)
# en caso de una reg
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/li...
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
2009 Jan 14
2
Vectorization of three embedded loops
Dear R-programmer,
I wrote an adapted implementation of the Kennard-Stone algorithm for
sample selection of multivariate data (R 2.7.1 under MacBook Pro,
Processor 2.2 GHz Intel 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
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/li...
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 do...
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/li...
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 an...
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
>>> htt...
2003 Jul 01
1
Creating a loop that works....
Hi there,
First off, thanks to everyone who has helped me so far. Sorry to keep
pestering you all.
I'm including my code here, and I will comment down it where it is that I am
having problems figuring out how to write this damn thing.
> temper <- scan("temp2.dat", na.strings = ".", list(Day=0, Temp=0))
Read 366 records
>
> Day <- temper$Day ;
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 maili...
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
> >&...
2010 Nov 15
1
Aggregate on identical link attributes
Hello R community,
I need to do some aggregation based on the test data below. The below
code works ok, but when its applied to my real data which includes over
9,000 records the process runs for over an hour. I know there is a more
efficient way of doing this. I want to Sum the below data's volumes where
FNODE and TNODE match,
i.e. FNODE=1 and TNODE =20 -> Volume=100 ,
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 -- T...