Title: | Data Cleaning |
---|---|
Description: | Includes functions that researchers or practitioners may use to clean raw data, transferring html, xlsx, txt data file into other formats. And it also can be used to manipulate text variables, extract numeric variables from text variables and other variable cleaning processes. It is originated from a author's project which focuses on creative performance in online education environment. The resulting paper of that study will be published soon. |
Authors: | Xiaorui(Jeremy) Zhu |
Maintainer: | Xiaorui(Jeremy) Zhu <[email protected]> |
License: | GPL-3 |
Version: | 1.0 |
Built: | 2024-11-12 06:29:19 UTC |
Source: | CRAN |
This is a function that use to match original data and addin data with identified variable.
consolida(row, data, mergeVar)
consolida(row, data, mergeVar)
row |
One sample that is already divided from the original file. |
data |
The "addin" file. |
mergeVar |
The variable that use to merge. |
This function is for internal use only, so no need to export it. It figures out the ID in the "addin" file then merge variables in addin file to the original file. This function is used for further "lapply" porcess.
is single line contains original variables and addin variables.
Xiaorui.Zhu
If you want to collect all files under certain folder, this function should be the perfect one. It will collect all files with certain name. Then this function will return a list will all paths of those files so that further import or read is feasible.
getSfilesPath(root.path, filename)
getSfilesPath(root.path, filename)
root.path |
is the root path including all folders and files that you would like to search. |
filename |
is the name of files that you want to collect. |
The whole paths of all files that meet the criteria were saved as a list.
getSfilesPath(root.path = R.home(), filename = "?.exe")
getSfilesPath(root.path = R.home(), filename = "?.exe")
"htmltodata" function is used to transfer information from html files to R or xlsx files
htmltodata(path)
htmltodata(path)
path |
is the path of the file that you want to import into R and then export. |
The return data are a list include all text results of submitters' answers.
Xiaorui(Jeremy) Zhu
This is a function that can be used to merger xlsx file using identified variables.
MergerXLSX(original_file, addin_file, mergeID)
MergerXLSX(original_file, addin_file, mergeID)
original_file |
The name of original file. This file contains all original data. It should be a "xlsx" file and saved in the same working folder. This input must be a character string of file name if it is saved in working directory, or it should include saving path of file. |
addin_file |
The file that need to be merged. It should be "xlsx" file and saved in the same working folder. |
mergeID |
The merger variable name in both files. The variable name should be same in two files. |
This function need three parameters. First is name of the original file that contains original data. Second is name of file that need to be merged. Third is the identifiable variable name that in both files.
Return data are all original data with addin variables.
Xiaorui (Jeremy) Zhu
Author's Github https://github.com/XiaoruiZhu. If you have trouble with rJava or xlsx, please check http://stackoverflow.com/questions/7019912/using-the-rjava-package-on-win7-64-bit-with-r for further information to fix it.
# file1 <- "C:/data.xlsx" # file2 <- "C:/data2.xlsx" # merged <- MergerXLSX(file1, file2, mergeID)
# file1 <- "C:/data.xlsx" # file2 <- "C:/data2.xlsx" # merged <- MergerXLSX(file1, file2, mergeID)