#Creating the data file
tags <- c("Clad", "Sinu", "Sarco", "Loph")
site <- c(rep("Site1", times = 100),
rep("Site2", times = 100),
rep("Site3", times = 100),
rep("Site4", times = 100))
row <- c(sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE))
column <- c(sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE),
sample(x = c(1:2000), size = 100, replace = TRUE))
label <- c(sample(x = tags, size = 100, replace = TRUE),
sample(x = tags, size = 100, replace = TRUE),
sample(x = tags, size = 100, replace = TRUE),
sample(x = tags, size = 100, replace = TRUE))
coral_annotations <- data.frame(site, row, column, label)
crop_area_coral <- crop_area(data = coral_annotations, row = "row",
column = "column", id = "site", dim = c(0.5, 0.5))
coral_annotations$col_dim <- 2000
coral_annotations$row_dim <- 2000
crop_area_coral_2 <- crop_area(data = coral_annotations, row = "row",
column = "column", id = "site", dim = c(0.5, 0.5),
res = TRUE, res_dim_x = "col_dim", res_dim_y = "row_dim")
Run the code above in your browser using DataLab