Title: | MedPC Text Parser |
---|---|
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. |
Authors: | Olivia Ortelli, Tony Colarusso |
Maintainer: | Olivia Ortelli <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-16 03:29:25 UTC |
Source: | https://github.com/cran/medparser |
Converts string into integer
DecimalStringToInteger(string)
DecimalStringToInteger(string)
string |
Character to be converted into an integer |
integer |
An integer |
Olivia Ortelli, Tony Colarusso
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))
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))
Pulls indices from MPC arrays
PullStringFromIndex(allText, index)
PullStringFromIndex(allText, index)
allText |
Character string containing MPC file |
index |
A number specifying the index where the array or value of interest begins in the MPC file |
stringValue |
A character string following the index start |
Olivia Ortelli, Tony Colarusso
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))
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))
Pulls string following specified text
PullStringFromTextSearch(allText, text)
PullStringFromTextSearch(allText, text)
allText |
Character string containing MPC file |
text |
A character string where matches are searched for |
stringValue |
A character string where matches are searched for |
Olivia Ortelli, Tony Colarusso
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser") allText = readLines(file_path) SubjectID = PullStringFromTextSearch(allText, "Subject:")
file_path <- system.file("extdata", "ExampleMPCOutput.txt", package = "medparser") allText = readLines(file_path) SubjectID = PullStringFromTextSearch(allText, "Subject:")
Pulls timestamps in H:M:S format
TimestampPull(allText, HMSindex)
TimestampPull(allText, HMSindex)
allText |
Character string containing MPC file |
HMSindex |
A number specifying the index to pull from the H, M, and S arrays |
HMS |
A single character combining the values from the H, M, and S arrays to read a complete time stamp (H:) |
Olivia Ortelli, Tony Colarusso
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)
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)