Related
username I have a list of methods like avgs = c(1,2,3)
and a function: simulate <- function (avg)
{ rnorm(n=10,m=avg,sd=1) }
What's the best way to get a vector of 30 values instead of a multidimensional array from it sapply(avgs,simulate)? Payton In your ca
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Amadou Kone I have two vectors of different lengths and I want to apply a function to every possible combination of the two vectors, resulting in a matrix. In my particular example, the two vectors are character vectors and I want to apply the function grepl,
Daniel James I want to split a vector into sub-vectors of different lengths by stating the average length of the sub-vectors. I was able to find an answer that only gave clues but not the answer I wanted ts <- 1:23 # the parent vector
bs <- 3 # lenght of subve
Daniel James I want to split a vector into sub-vectors of different lengths by stating the average length of the sub-vectors. I was able to find an answer that only gave clues but not the answer I wanted ts <- 1:23 # the parent vector
bs <- 3 # lenght of subve
Daniel James I want to split a vector into sub-vectors of different lengths by stating the average length of the sub-vectors. I was able to find an answer that only gave clues but not the answer I wanted ts <- 1:23 # the parent vector
bs <- 3 # lenght of subve
Daniel James I want to split a vector into sub-vectors of different lengths by stating the average length of the sub-vectors. I was able to find an answer that only gave clues but not the answer I wanted ts <- 1:23 # the parent vector
bs <- 3 # lenght of subve
Daniel James I want to split a vector into sub-vectors of different lengths by stating the average length of the sub-vectors. I was able to find an answer that only gave clues but not the answer I wanted ts <- 1:23 # the parent vector
bs <- 3 # lenght of subve
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
Toby I need to combine some named numeric vectors in R into one dataframe. I tried it cbind.nain another question as a suggestion hint, but the name won't be considered. example: v1 <- c(1,5,6,7)
names(v1) <- c("milk", "flour", "eggs", "sugar")
v2 <- c(2,3)
na
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
Toby I need to combine some named numeric vectors in R into one dataframe. I tried it cbind.nain another question as a suggestion hint, but the name won't be considered. example: v1 <- c(1,5,6,7)
names(v1) <- c("milk", "flour", "eggs", "sugar")
v2 <- c(2,3)
na
Toby I need to combine some named numeric vectors in R into one dataframe. I tried it cbind.nain another question as a suggestion hint, but the name won't be considered. example: v1 <- c(1,5,6,7)
names(v1) <- c("milk", "flour", "eggs", "sugar")
v2 <- c(2,3)
na
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
Matthew Maylin I want to use a for loop to generate multiple vectors and save their values for later use. The ideal end result is: vector_1 = c(1)
vector_2 = c(1,2,3)
vector_3 = c(1,2,3,4,5,6)
.
.
.
vector_i = c(1,2,3,...,n) #for some n generated during the lo
lengthy Suppose we have a table: std::vector< std::vector<int> > table(3, std::vector<int>)it looks like this: 11 21 31 41 45 51 61
71 81 91 10 19 29
39 49 59 69 79 89 99 109
The total number of elements we get int nThPosis between 1 and N table(21 here).
lengthy Suppose we have a table: std::vector< std::vector<int> > table(3, std::vector<int>)it looks like this: 11 21 31 41 45 51 61
71 81 91 10 19 29
39 49 59 69 79 89 99 109
The total number of elements we get int nThPosis between 1 and N table(21 here).
Selm I'm actually having trouble expressing my problem, so if anyone has feedback on this, I'd love to hear it. I'm working in R and have a vector and a dataframe of varying lengths: xp.data <- c(400,500,600,700)
XPTable <- data.frame("Level"=1:10,"XP"=c(10,50
osfomk I have two vectors of different lengths and want to get all the occurrences of the first vector in the second vector. I tried: vec <- c("jan-fev-mar", "abr-mai-jun", "jul-ago-set")
vec2 <- c("jan-fev-mar", "abr-mai-jun", "jul-ago-set", "out-nov-dez", "
osfomk I have two vectors of different lengths and want to get all the occurrences of the first vector in the second vector. I tried: vec <- c("jan-fev-mar", "abr-mai-jun", "jul-ago-set")
vec2 <- c("jan-fev-mar", "abr-mai-jun", "jul-ago-set", "out-nov-dez", "
FRV I have two vectors: A <- 10 10 20 19 24 24 17 18 24 24 24 25 16 16 16 25 25 12 12 12 25 24 24 24 24 2 2
and B <- 2 4 2 2 2 3 2 3 2 3 2
I want to compare the first two elements of A (here: ) 10 10. Why? Because the first entry of B is two. Then, I want
i I am trying to add two vectors. a is 41, 5 b is 28, 5, 3, 1 i just try to do this c <- a + b
The answer is 69, 10, 44, 6. I guess it's reused? I want c 69, 10, 3, 1after adding a and b together. I have absolutely no experience with R, so please keep the sol
FRV I have two vectors: A <- 10 10 20 19 24 24 17 18 24 24 24 25 16 16 16 25 25 12 12 12 25 24 24 24 24 2 2
and B <- 2 4 2 2 2 3 2 3 2 3 2
I want to compare the first two elements of A (here: ) 10 10. Why? Because the first entry of B is two. Then, I want