Mercurial > repos > davidvanzessen > shm_csr
comparison shm_csr.r @ 25:8d1c4c75f81b draft
Uploaded
author | davidvanzessen |
---|---|
date | Mon, 05 Dec 2016 08:26:01 -0500 |
parents | 9955b23db68c |
children | a24f8c93583a |
comparison
equal
deleted
inserted
replaced
24:9955b23db68c | 25:8d1c4c75f81b |
---|---|
460 print(p) | 460 print(p) |
461 dev.off() | 461 dev.off() |
462 | 462 |
463 frequency_bins_data_by_class = frequency_bins_data | 463 frequency_bins_data_by_class = frequency_bins_data |
464 | 464 |
465 frequency_bins_data_by_class = frequency_bins_data_by_class[order(frequency_bins_data_by_class$best_match_class, frequency_bins_data_by_class$frequency_bins),] | |
466 | |
467 frequency_bins_data_by_class$frequency_bins = gsub("-", " to ", frequency_bins_data_by_class$frequency_bins) | |
468 frequency_bins_data_by_class[frequency_bins_data_by_class$frequency_bins == "20", c("frequency_bins")] = "20 or higher" | |
469 frequency_bins_data_by_class[frequency_bins_data_by_class$frequency_bins == "0", c("frequency_bins")] = "0 or lower" | |
470 | |
465 write.table(frequency_bins_data_by_class, "frequency_ranges_classes.txt", sep="\t",quote=F,row.names=F,col.names=T) | 471 write.table(frequency_bins_data_by_class, "frequency_ranges_classes.txt", sep="\t",quote=F,row.names=F,col.names=T) |
466 | 472 |
467 frequency_bins_data = data.frame(data.table(dat)[, list(frequency_count=.N), by=c("best_match", "best_match_class", "frequency_bins")]) | 473 frequency_bins_data = data.frame(data.table(dat)[, list(frequency_count=.N), by=c("best_match", "best_match_class", "frequency_bins")]) |
468 | 474 |
469 frequency_bins_sum = data.frame(data.table(dat)[, list(class_sum=sum(.N)), by=c("best_match")]) | 475 frequency_bins_sum = data.frame(data.table(dat)[, list(class_sum=sum(.N)), by=c("best_match")]) |
470 | 476 |
471 frequency_bins_data = merge(frequency_bins_data, frequency_bins_sum, by="best_match") | 477 frequency_bins_data = merge(frequency_bins_data, frequency_bins_sum, by="best_match") |
472 | 478 |
473 frequency_bins_data$frequency = round(frequency_bins_data$frequency_count / frequency_bins_data$class_sum * 100, 2) | 479 frequency_bins_data$frequency = round(frequency_bins_data$frequency_count / frequency_bins_data$class_sum * 100, 2) |
474 | 480 |
481 frequency_bins_data = frequency_bins_data[order(frequency_bins_data$best_match, frequency_bins_data$frequency_bins),] | |
482 frequency_bins_data$frequency_bins = gsub("-", " to ", frequency_bins_data$frequency_bins) | |
483 frequency_bins_data[frequency_bins_data$frequency_bins == "20", c("frequency_bins")] = "20 or higher" | |
484 frequency_bins_data[frequency_bins_data$frequency_bins == "0", c("frequency_bins")] = "0 or lower" | |
485 | |
475 write.table(frequency_bins_data, "frequency_ranges_subclasses.txt", sep="\t",quote=F,row.names=F,col.names=T) | 486 write.table(frequency_bins_data, "frequency_ranges_subclasses.txt", sep="\t",quote=F,row.names=F,col.names=T) |
476 | 487 |
477 | 488 |
478 | 489 |
479 | 490 |