Skip to content

Commit

Permalink
Bugfix release v1.0.2
Browse files Browse the repository at this point in the history
Fix automatic detection of file name in all "file_" functions #9
  • Loading branch information
trettenbrein committed Aug 4, 2021
1 parent 0ae2123 commit 1da7f48
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
7 changes: 3 additions & 4 deletions R/file_acceleration.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ file_acceleration <- function(file, model, fps = 25) {
# Check whether file name contains information about model
# If file was created by create_csv() then it should
if(missing(model)) {
if(as.logical(grep("_body25", file))==TRUE) {
if(grepl("_body25", file)==TRUE) {
model <- "body25"
} else if(as.logical(grep("_hand_left", file))==TRUE | as.logical(
grep("_hand_right", file))==TRUE ) {
} else if(grepl("_hand_left", file)==TRUE | grepl("_hand_right", file)==TRUE ) {
model <- "hands"
} else if(as.logical(grep("_face", file))==TRUE) {
} else if(grepl("_face", file)==TRUE) {
model <- "face"
} else {
stop("Argument \"model\" must be specified. Tell me from which model the data came from (body25, hands, or face).", call. = FALSE)
Expand Down
7 changes: 3 additions & 4 deletions R/file_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ file_clean <- function(file, model, cutoff = 0.1, overwrite = TRUE) {
# Check whether file name contains information about model
# If file was created by create_csv() then it should
if(missing(model)) {
if(as.logical(grep("_body25", file))==TRUE) {
if(grepl("_body25", file)==TRUE) {
model <- "body25"
} else if(as.logical(grep("_hand_left", file))==TRUE | as.logical(
grep("_hand_right", file))==TRUE ) {
} else if(grepl("_hand_left", file)==TRUE | grepl("_hand_right", file)==TRUE ) {
model <- "hands"
} else if(as.logical(grep("_face", file))==TRUE) {
} else if(grepl("_face", file)==TRUE) {
model <- "face"
} else {
stop("Argument \"model\" must be specified. Tell me from which model the data came from (body25, hands, or face).", call. = FALSE)
Expand Down
7 changes: 3 additions & 4 deletions R/file_velocity.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ file_velocity <- function(file, model, fps = 25) {
# Check whether file name contains information about model
# If file was created by create_csv() then it should
if(missing(model)) {
if(as.logical(grep("_body25", file))==TRUE) {
if(grepl("_body25", file)==TRUE) {
model <- "body25"
} else if(as.logical(grep("_hand_left", file))==TRUE | as.logical(
grep("_hand_right", file))==TRUE ) {
} else if(grepl("_hand_left", file)==TRUE | grepl("_hand_right", file)==TRUE ) {
model <- "hands"
} else if(as.logical(grep("_face", file))==TRUE) {
} else if(grepl("_face", file)==TRUE) {
model <- "face"
} else {
stop("Argument \"model\" must be specified. Tell me from which model the data came from (body25, hands, or face).", call. = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For details on what OpenPoseR can (and can't) do, respectively, how you can use

## Installation

For now, OpenPoseR (current version: 1.0.1) can be installed using the following commands (you will need to have the ``devtools`` package installed):
For now, OpenPoseR (current version: 1.0.2) can be installed using the following commands (you will need to have the ``devtools`` package installed):

```r
# Install devtools from CRAN (if not already installed)
Expand Down

0 comments on commit 1da7f48

Please sign in to comment.