Skip to content

[CFFDRS R Bug]: Slopecalc.R Throwing NaNs, likely to be rejected by CRAN for this. #31

Description

@BadgerOnABike

Contact Details

No response

What happened?

NaNs being thrown from

cffdrs_r/R/Slopecalc.r

Lines 95 to 105 in e4ae568

ISF <- ifelse(
FUELTYPE %in% c(
"C1", "C2", "C3", "C4", "C5", "C6", "C7", "D1", "S1", "S2", "S3"
),
ifelse(
(1 - (RSF / a[FUELTYPE])**(1 / c0[FUELTYPE])) >= 0.01,
log(1 - (RSF / a[FUELTYPE])**(1 / c0[FUELTYPE])) / (-b[FUELTYPE]),
log(0.01) / (-b[FUELTYPE])
),
ISF
)

It seems like the if else isn't being respected?

I'm pretty sure its because the Fueltype is being trimmed but the RSF isn't.

Any ideas @jordan-evens? I'll keep prodding.

Relevant log output

ISF <- ifelse(
     FUELTYPE %in% c(
       "C1", "C2", "C3", "C4", "C5", "C6", "C7", "D1", "S1", "S2", "S3"
     ),
     ifelse(
       (1 - (RSF / a[FUELTYPE])**(1 / c0[FUELTYPE])) >= 0.01,
       log(1 - (RSF / a[FUELTYPE])**(1 / c0[FUELTYPE])) / (-b[FUELTYPE]),
       log(0.01) / (-b[FUELTYPE])
     ),
     ISF
   )
Warning in log(1 - (RSF/a[FUELTYPE])^(1/c0[FUELTYPE])) : NaNs produced

Approvals Process

  • Testing For Issue
  • Merge

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions