seanmcm / RDendrom

R package for analysis, diagnostics, and presentation of intra-annual tree growth time series
1 stars 0 forks source link

New error #2

Closed mcgregorian1 closed 5 years ago

mcgregorian1 commented 5 years ago

Hi @seanmcm

I've tried the code again (prepping for a thing with high schoolers showing how the dendroband data can be analyzed), and I found the following error when running get.optimized.dendro. I'm not sure what's gone wrong here.

image

Here is the dataset I was using.

seanmcm commented 5 years ago

@mcgregorian1 did you fix this? I get this usually when there is a missing value in ORG_DBH[1] or an NA in GAP_WIDTH (anywhere). So i do complete.cases(dataf$GAP_WIDTH) before beginning.

couldn't get the data if you're still having trouble. Please reload the package as well, as I've changed some things (minor, but bugs also).

mcgregorian1 commented 5 years ago

I've double-checked the df and there are no missing elements, but I'm getting the same error message.

I think you have access to our Dendroband repo? https://github.com/SCBI-ForestGEO/Dendrobands/blob/master/results/tree_10045.csv

If not let me know and I can send the file via email

seanmcm commented 5 years ago

@mcgregorian1 Looks like there is no $ORG_DBH, that is, the original dbh which is needed to translate the gap width into a starting DBH, and then build "TRUE_DBH" from the changes in the increment in the gap.

mcgregorian1 commented 5 years ago

@seanmcm in the file I linked there is an ORG_DBH, which is column 22.

seanmcm commented 5 years ago

@mcgregorian1 I fixed some code that created that error. But it had to do with extra bands. this afternoon I'll check the data you linked to. sorry I didn't see to scroll right to find many more columns!

mcgregorian1 commented 5 years ago

That's fine! Let me know when you'd like me to try again on my end

mcgregorian1 commented 5 years ago

Hi @seanmcm

I tried your code again, and it's worked. However, I've gotten an error further down that I'm unsure about what it means? The graphs were still made, though, so I'm not sure of its importance.

image image image

The other thing is that in Dendro.split I'm getting NULL values; it seems these are made because of incomplete growing seasons? e.g. Dendro.split[[1]] is supposed to be data from 2010, but that only has one data point. Dendro.split[[10]] is the data from 2019, for which we have half a year's data so far. I'm assuming the fact that it's NULL is because your code is recognizing it as not complete? image

seanmcm commented 5 years ago

Got it. This likely disrupted other output. Data-set is a variable we use to designate different projects. I’ll fix that this evening so you can run it again. Thanks.

Sent from my iPhone

On Jun 18, 2019, at 13:52, Ian McGregor notifications@github.com wrote:

Hi @seanmcm

I tried your code again, and it's worked. However, I've gotten an error further down that I'm unsure about what it means? The graphs were still made, though, so I'm not sure of its importance.

The other thing is that in Dendro.split I'm getting NULL values; it seems these are made because of incomplete growing seasons? e.g. Dendro.split[[1]] is supposed to be data from 2010, but that only has one data point. Dendro.split[[10]] is the data from 2019, for which we have half a year's data so far. I'm assuming the fact that it's NULL is because your code is recognizing it as not complete?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

seanmcm commented 5 years ago

@mcgregorian1 OK, fixed the DATA_SET problem. you should re-run. For NULL values, I set a minimum observations in the time series to 9. this is an argument in the get.optimized.dendro function and so can be changed. The NULL is kept in so that it still maps to the param.table output data.frame with summary results for each time series. This way, the number of rows in the data.frame should be the same as the number of elements in the Dendro.split output. The data.frame will have NAs for fit parameters, but still retain details about what was not fit (year, species, tree_id, etc.). do you think I should change this?

mcgregorian1 commented 5 years ago

Hm, that's a good question. I think it depends on what your original reason for limiting the minimum to 9 observations was. What's the min number you need to create the growth curve? I don't have a sound scientific reason off the top of my head that it should be lower, except for that perhaps someone would want to see how the growth trajectory of a tree in the current year is going, even though that year isn't done yet.

Other error

I downloaded your edits from Github and I'm now receiving this when using the code devtools::install_github("seanmcm/RDendrom") image

seanmcm commented 5 years ago

@mcgregorian1 OK Should work now. had to clean and re-build after removing a redundant function.

mcgregorian1 commented 5 years ago

@seanmcm I just tested it and the main functions ran well. Looks good!