Re: [R] How to save output of multiple loops in a matrix

2020-03-23 Thread PIKAL Petr
právně závaznému prohlášení o vyloučení odpovědnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/ > -Original Message- > From: R-help

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Jeff Newmiller
t;)))) + D2L[3]* (as.numeric(unlist(str_split(as.character(d1[calc_rows & DS2_rows,]$Y_vals), pattern = ","))) - as.numeric(unlist(str_split(as.character(d1[calc_rows & DS3_rows,]$Y_vals), pattern = "," + D2L[4] * (as.numeric(

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
} Vul <- distinct(d1[,c(1,2)]) dim(VC) <- c(length(unlist(str_split(as.character(d1[2,]$Y_vals), pattern = ","))),length(distinct(d1[,c(1,2)])$Name)) ## (rows, cols) VC VC_t <- t(VC) Vulnerability <- matrix(apply(VC_t, 1, function(x) paste(x, collapse = ',')

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Jeff Newmiller
You have again posted using HTML and the result is unreadable. Please post a reproducible example using dput instead of assuming we can read your formatted code or table. On March 21, 2020 8:59:58 AM PDT, Ioanna Ioannou wrote: >Hello everyone, > >I am having this data.frame. For each row you h

[R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
Hello everyone, I am having this data.frame. For each row you have 26 values aggregated in a cell and separated by a comma. I want to do some calculations for all unique names and taxonomy which include the four different damage states. I can estimate the results but i am struggling to save the