DIFM-Brain / ofpetrial

GNU General Public License v3.0
0 stars 1 forks source link

assign_rates() produces an error sometimes when there is a gap in a strip #8

Closed tmieno2 closed 5 months ago

tmieno2 commented 5 months ago

@brittanikedge, can you share the necessary files to replicate this?

brittanikedge commented 5 months ago

@tmieno2 I shared them on Teams. I tried here, but the file types aren't supported. Let me know if you don't see them.

tmieno2 commented 5 months ago

I got the files. Thanks!

tmieno2 commented 5 months ago

@brittanikedge, can you share the error message you got (screenshot of what you showed me yesterday)?

brittanikedge commented 5 months ago
Screenshot 2024-04-11 at 9 10 00 AM

I tried to replicate it, but the message changed. This is the error from make_exp_plots(). It looks like the original boundary was a multipolygon, and at some point in the functions, it becomes two features, a polygon and a linestring.

I just noticed something very odd. Even when I clean out my working environment, exp_data still exists. Do you know if this something about working with the package R project open?

tmieno2 commented 5 months ago

I am not sure. But, I think it is because of the changes I made to the code to fix spatial inbalance. I was using max(working_strip$plot_id) as the number of plots, which would fail if we have multiple poly_lines in a single plot because plot_id starts at 1 again when a new poly_line starts. The code you provided now runs. Can you try it?

brittanikedge commented 5 months ago

Okay, I will pull your changes and run again. I'll let you know shortly how it goes.

brittanikedge commented 5 months ago

@tmieno2 It now runs for me as well! I will update Professor Bullock. He is the one who was trying to run this trial.

I need to do something for Eric on a trial report, then I will be working on the report edits. I noticed a problem with the machine figures for one of the examples I'm testing.