search for: imij

Displaying 4 results from an estimated 4 matches for "imij".

Did you mean: iij
2002 Mar 20
3
check without loop
i am probably just missing this one, but how can i check to see if a number is a part of a vector? i know i could do a loop checking for equivalence for each element, but i am thinking that there must be a simpler way to do it than that ( i think that i have even done it in the past, but can't remember how!) thanks what i am working with: (hope this makes sense) arclist [1] 2 2 6
2002 Mar 20
7
how does while work
i am having some problems with a program that i am writing and i think that knowing how the while command works will help me to figure out where i am going wrong *when do you get kicked out of a while loop?* (i.e., in the following example what would the final value of 'a' be?) i thought it would be 99 but running it in R i get 101 (and 101 for x too!) while (x <100) { for (i in
2002 Mar 08
2
? about sample
i am trying to use the sample command and have one question about it: i am getting the error Error in sample(length(x), size, replace, prob) : insufficient positive probabilities when i use something like: sample (1:4, prob=c(0,0,1,0))[1] i was expecting that to return a 3 every time while this is not exactly what i am using it for, i need the capabilities to deal with zeros (as the
2002 Apr 08
2
changing the form of a list
i have a 2 x n matrix that is a paired list of connections, i am working with that looks something like: 1 2 1 3 1 5 2 1 2 3 3 1 3 2 4 5 5 1 5 4 for later operations it would be helpful if i could change this into the form of: 1 2 3 5 2 1 3 3 1 2 4 5 5 1 4 the initial list is randomly generated and the max number of times that any one number can appear is previoulsy defined by a limiting