Code: Alles auswählen
read.csv("http://forum.r-statistik.de/download/file.php?id=1634", sep = ";", fileEncoding = "UTF-8-BOM", stringsAsFactors = FALSE)
Schöne Grüße in die Versicherung!
Code: Alles auswählen
read.csv("http://forum.r-statistik.de/download/file.php?id=1634", sep = ";", fileEncoding = "UTF-8-BOM", stringsAsFactors = FALSE)
Nicht nur sehr effizient, sondern auch sehr elegant !Ich nehme an, dass sich hinter Athomas' Link eine sehr effiziente Lösung verstecken dürfte.
Code: Alles auswählen
library(combinat)
Daten <- matrix(rnorm(25), ncol=5)
permsum <- function(vektor) sum(Daten[cbind(1:length(vektor), vektor)])
Ergebnis <- sapply(permn(1:5), permsum)