Type: | Package |
Title: | MedPC Text Parser |
Version: | 0.1.0 |
Author: | Olivia Ortelli, Tony Colarusso |
Maintainer: | Olivia Ortelli <oortelli@wakehealth.edu> |
Description: | Parses information from text files with specific utility aimed at pulling information from Med Associate's (MPC) files. These functions allow for further analysis of MPC files. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-04-25 20:51:14 UTC; oorte |
Repository: | CRAN |
Date/Publication: | 2024-04-27 18:20:03 UTC |
DecimalStringToInteger
Description
Converts string into integer
Usage
DecimalStringToInteger(string)
Arguments
string |
Character to be converted into an integer |
Value
integer |
An integer |
Author(s)
Olivia Ortelli, Tony Colarusso
Examples
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser")
allText = readLines(file_path)
B_index = 1+grep("B:", allText[-1], value = FALSE)
Left_LeverPressBout = DecimalStringToInteger(PullStringFromIndex(allText,B_index+1))
PullStringFromIndex
Description
Pulls indices from MPC arrays
Usage
PullStringFromIndex(allText, index)
Arguments
allText |
Character string containing MPC file |
index |
A number specifying the index where the array or value of interest begins in the MPC file |
Value
stringValue |
A character string following the index start |
Author(s)
Olivia Ortelli, Tony Colarusso
Examples
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser")
allText = readLines(file_path)
B_index = 1+grep("B:", allText[-1], value = FALSE)
Left_LeverPressBout = DecimalStringToInteger(PullStringFromIndex(allText,B_index+1))
PullStringFromTextSearch
Description
Pulls string following specified text
Usage
PullStringFromTextSearch(allText, text)
Arguments
allText |
Character string containing MPC file |
text |
A character string where matches are searched for |
Value
stringValue |
A character string where matches are searched for |
Author(s)
Olivia Ortelli, Tony Colarusso
Examples
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser")
allText = readLines(file_path)
SubjectID = PullStringFromTextSearch(allText, "Subject:")
TimestampPull
Description
Pulls timestamps in H:M:S format
Usage
TimestampPull(allText, HMSindex)
Arguments
allText |
Character string containing MPC file |
HMSindex |
A number specifying the index to pull from the H, M, and S arrays |
Value
HMS |
A single character combining the values from the H, M, and S arrays to read a complete time stamp (H:) |
Author(s)
Olivia Ortelli, Tony Colarusso
Examples
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser")
allText = readLines(file_path)
C_index = 1+grep("C:", allText[-1], value = FALSE)
H_index = 1+grep("H:", allText[-1], value = FALSE)
M_index = 1+grep("M:", allText[-1], value = FALSE)
NumberOfTimestampsRecorded = (M_index-1)-(H_index+1)
firsttimestamp = TimestampPull(allText,1)