Identify and corrects variable formats
The function creates a loop to compare for each variable the values it have with the usual ones that typical R formats have in order to correct, for example, missing value or dates stored as a character. It also specify for each variable the most appropriate SPSS format that it should have.
The data set we want to correct.
The name of the identification variable included in the data frame. It will be used to list the individuals who had any problems during the execution of the function.
If TRUE, run format_corrector even if "fixed.formats" attribute is TRUE
The maximum rate of missing date fields we want the function to accept.The function details which fields have been lost anyways.
If the date variable don't have chron format it must be in one of the following formats, else the function leaves it as a character:
—-dates separator must be one of the following:("-","/",".").
—-hour separator must be ":".
A single data frame which results from the function.
This function may not be completely optimal so it might have problems when correcting huge data frames.
1 2 3 4 5 6 7 8
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.