R/do_lines_colors.R

Defines functions .do_lines_colors

.do_lines_colors <- function(lines.df, objects.df, color.param){
  if(sum(lines.df[, 1] %in% objects.df$id) > 1){
    lines.df <- merge(lines.df,
                      objects.df[, c("id", color.param)],
                      by.x="from", by.y="id")
  } else{
    lines.df <- merge(lines.df,
                      objects.df[, c("id", color.param)],
                      by.x="to", by.y="id")
  }
  lines.df
}

Try the archeoViz package in your browser

Any scripts or data that you put into this service are public.

archeoViz documentation built on June 22, 2024, 10:04 a.m.