-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue #133 file locations for distances matrix() #145
base: master
Are you sure you want to change the base?
Issue #133 file locations for distances matrix() #145
Conversation
… to specify a file pathway when the spatial.csv is not in the main working directory. Also compressed the function code to 80c limit
…how a check operated when looking for a warning.
Notes based on discussion with Hugo: If distancesMatrix() is called without starters, have function look for spatial.csv in current working directory (this is the current functionality). Utilize the loadSpatial() function being called before distancesMatrix() for other processes. This would have the existing path of spatial.csv already denoted in it. Use the output of loadSpatial() as a input for distancesMatrix() which would be put in the starters argument. This would bypass the need for an additional argument while still providing the information needed to run distancesMatrix(). Starters and targets in distancesMatrix() define endpoints used to calculate distances. Normally, these two are the same values (as we want to calculate the distances between every pair of points). Currently, if actel = TRUE, distancesMatrix() will ignore the starters argument. However, distancesMatrix() should inherently always try to optimize the output for actel. Summary: Relax the distancesMatrix() function so it accepts starters regardless of actel being TRUE or not. Allow the user to supply the output of loadSpatial() to starters so the spatial.csv can be accessed. Keep the default functionality of distanceMatrix() the same where if no starters are provided, distancesMatrix() looks for a spatial.csv in the current working directory. @hugomflavio Please give this a read through and provide feedback if something requires rectifying. |
Looks good. One comment:
I'd rephrase this thought to: However, distancesMatrix() should try to optimize the output for actel if Had a quick look at distancesMatrix() to see if anything else could go wrong. It seems it already has fail-safes for if id.col does not exist. It still makes sense for force id.col to be "Standard.name" when actel = TRUE, as that is what actel will look for. I suppose distancesMatrix() should crash if 1) actel = TRUE and 2) starters/targets were supplied but do not contain a column called "Standard.name". |
…ations-for-distancesMatrix()
…f 'loadSpatial()' can now be used in place of starters when actel == TRUE
…moved old checks related to file_path and removed checks which checked for errors or warning no longer present.
…o be specified when actel == TRUE. This also allows 'loadSpatial()' to be used in starters to specify if the 'spatial.csv' is in a different working directory. Also updated code to allow 'distances.csv' to be saved to a specific folder if the user desires.
First push to address issue from a loadSpatial() approach. Function will now accept loadSpatial() output for starters and if no starters or targets are specified, then function searches and grabs 'spatial.csv' from working directory as done previously. The function will now allow starters and targets to be specified when actel == TRUE. If starters are applied and targets are left blank, starters will be used as targets. Added new code to the end allowing the user to specify the folder where the 'distances.csv' should be saved to. Or the user can have it left default and the 'distances.csv' will be saved to the working directory. Relevant documentation has been updated as well as news. The distancesMatrix() examples in the help documentation did seem confusing we should considering altering that to be more intuitive of how the function works right now. |
Updated
distanceMatrix()
to accept a new condition 'file_path'. This will solve issue [#133] where if the 'spatial.csv' is not in the main working directory the function will error. New checks have also been added for 'file_path in'distanceMatrix()
plus the documentation fordistanceMatrix()
has been updated to reflect 'file_path' being added.