Posts by Vinicius Soares • 31 points
4 posts
-
1
votes2
answers57
viewsQ: How to replicate a line with a difference of names on it? R
I have a function and I didn’t want to have to create a new line in it whenever I add a new object to it: a<- function(x1,x2,x3,x4){ res_x1= x1*4.95+x1 print("resultado x1") print(res_x1) res_x2=…
rasked Vinicius Soares 31 -
2
votes1
answer38
viewsQ: How to specify demand in lpSolveAPI in R?
I am trying to optimize profit by 4 different products, one that profits 600reais/unit other that profits 550/unit other that profits 400/unit and another that profits 300/unit. However, the demand…
rasked Vinicius Soares 31 -
0
votes3
answers518
viewsA: Conditional Sum on each R line?
I’ve managed to get the code for whoever wants it: objetoA <- 100 valor <- 20 objetoB <- 40 a <- c(1,2,3,4,5) b <- c(10,10,10,10,10) df <- data.frame(b,a) df[1,3] <- 100…
ranswered Vinicius Soares 31 -
0
votes3
answers518
viewsQ: Conditional Sum on each R line?
I’m trying to create a function that takes the fixed value of a row df[1.3] and subtracts it by the value of another row of a dataframe df[,1] and the result of that subtraction is also subtracted…
rasked Vinicius Soares 31