Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issue - Missing closing bracket in feature-helpers.R #10

Open
haas-christian opened this issue Oct 7, 2024 · 3 comments
Open

Comments

@haas-christian
Copy link

Hello,

First of all, thank you for this nice package. When I tried to install it, I received the error message

Error in parse(...) : 
  C:/../compactness/R/feature_helpers.R:83:3: unexpected symbol
82:   temp = lapply(1:nrow(shp[[1]]), FUN=function(x) get_one_bound_feature(x)
83:   out
      ^
ERROR: unable to collate and parse R files for package 'compactness'

Upon closer inspection, this is due to a missing closing bracket in line 82 of the feature_helpers.R file. When I downloaded the compactness package, manually changed the feature_helpers.R file, and then installed from the local version, it worked.

So, I'd suggest the following change for line 82 of feature_helpers.R (note the double closed bracket for the first line in the function):

get_all_bound_features = function(shp){  
      temp = lapply(1:nrow(shp[[1]]), FUN=function(x) get_one_bound_feature(x))  
      out = do.call(rbind, temp)  
      return(out) 
}

Just thought this might be helpful if other users have the same issue. Thanks!

@aaronrkaufman
Copy link
Owner

Thanks! Fixed. The package is currently under construction a bit (once I get out from under start of semester madness) to add some new features!

@haas-christian
Copy link
Author

Thanks! Looking forward to the additional features.

Unfortunately, I just realized that even though the bracket is now closed and the installation works, line 82 causes a different issue now:

Error in shp[[2]][x] : invalid subscript type 'list'

This seems to come from the get_all_bound_features function, calling get_one_bound_feature on line 82.

@aaronrkaufman
Copy link
Owner

Yes, I see! Take a look at the newest version. Note that you may need to set the following global option:

units::units_options(allow_mixed=T)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants