Skip to content

Commit

Permalink
fix issue of copied species names across data frame
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswyatt1 committed Aug 1, 2024
1 parent cc7ac73 commit 9eb937d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/r_processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for (x in 1:length(classif) ) {
my_res<-data.frame(do.call('rbind', strsplit(gsub(")", "",classif[[tvar]] ),'(',fixed=TRUE)))
my_tax <- strsplit(my_res$X1[1],':')[[1]][1]
full_name<- h[[paste0(strsplit(my_res$X1[1],':')[[1]][1])]]
my_res$X1 <- strsplit(my_res$X1[1],':')[[1]][2]
my_res$X1 <- sub("^[a-z]:", "", my_res$X1)
my_res$X2 <- as.numeric(my_res$X2)
tax_vars <- c(tax_vars, my_tax)
outdf <- cbind(outdf, my_res)
Expand All @@ -36,6 +36,7 @@ for (x in 1:length(classif) ) {
tablecolnames <- c(tablecolnames, prob_name )
}

#Add the size onto the table and give this a header of "size"
outdf <- cbind(outdf, size)
tablecolnames <- c(tablecolnames, "size" )
colnames(outdf)<-tablecolnames
Expand Down

0 comments on commit 9eb937d

Please sign in to comment.