Last active
May 10, 2021 17:25
-
-
Save sash-kan/2e629bdae2fe9250ceb0d312de261adf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/urs/bin/env Rscript | |
# параметрами передать список csv-файлов: | |
# Rscript script.r *.csv | |
f <- function(n) { | |
csv <- read.csv(n) | |
list(name = tools::file_path_sans_ext(n), | |
dgmin = min(csv$dG), | |
popmin = paste('(',csv[which.min(csv$dG), 'POP'],')',sep=''), | |
dgpopmx = csv[which.max(csv$POP), 'dG'], | |
popmax = paste('(',csv[which.max(csv$dG), 'POP'],')',sep=''), | |
dgmean = mean(csv$dG) | |
) | |
} | |
write.table( | |
do.call( | |
rbind, | |
lapply( | |
commandArgs( | |
trailingOnly = T | |
), | |
f | |
) | |
), | |
#col.names = c("Lig(CNE).","dG(min)","POP(min)","dG(popMAX)","POP(max)","dG(mean)"), | |
row.names = F, | |
quote = F, | |
sep = "\t" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
не устанавливая пакета
r-base-core
, можно и docker-образом воспользоваться для теста. поместите этот скрипт и ваши*.csv
в текущий каталог и выполните что-нибудь вроде$ docker run -it --rm -v $(pwd):/f dongzhuoer/rlang:base sh -c 'cd /f && Rscript script.r *.csv'