Open KathrinTessella opened 9 years ago
@goldingn Do we want to use the camelCase notation also for the following functions: 'as.locationdataframe', 'is.locationdataframe', 'as.movementmatrix', 'is.movementmatrix' ?
in which case 'as.locationdataframe.data.frame' would be renamed to 'asLocationdataframe.data.frame' and as.locationdataframe.SpatialPolygonsDataFrame => asLocationdataframe.SpatialPolygonsDataFrame
I think it should be consistent with the class name, for clarity and consistency with the S3 methods.
That said, we should rename these classes (and functions) into snake case. I.e. movement_matrix
, location_dataframe
, as.movement_matrix
etc.
@goldingn : the package contains the function R resultasdataframe()
which is not exported and not used within the package. Do we want such a functionality for the now named 'movement_predictions' object? Otherwise we should remove this function as its not used.
yes, could you please define, document and export as.data.frame.movement_matrix
, using this code but making the input a movement_matrix
. This will be useful for converting the movement matrices into a form people can use.
@goldingn : to get the 'origin' and 'destination' columns for the R data.frame
from the R as.data.frame.movement_matrix
I require some form of location information. For matrices with column & row names, this information can be extracted from the matrices themselves, but in most cases the columns & row names are not useful.
Is it ok to take the R location_dataframe
object as a 2nd argument for the method to receive the 'origin' and 'destination' information from that structure ?
Hmmm... I would rather enforce that the row and column names are meaningful whenever creating a movement_matrix
. We could then also check that these line up with the location_dataframe
locations during model fitting which would be safer.
We can issue a warning or an error if something is coerced into a movement_matrix
without row and column names.
Ok - I will then update the method accordingly and created a new issue (see https://github.com/SEEG-Oxford/movement/issues/99) to ensure that the column & row names are set correctly.
In the following we will use the following naming convention: function names using camelCase notation arguments, objects and class names using snake_case (underscore for separating) In general, the 'dot' notation should be avoided.
Other elements of style should follow the Google style guide: https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml except that function documentation should go above functions, since they’re roxygen docs.