Skip to content

Commit

Permalink
Minor code change
Browse files Browse the repository at this point in the history
  • Loading branch information
N-thony committed Mar 10, 2022
1 parent be74004 commit 976f90b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions instat/dlgName.vb
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ Public Class dlgName
clsDefaultRFunction.RemoveParameterByPosition(5)
RemoveLabelsParams()
ElseIf rdoRenameWith.Checked Then
clsDefaultRFunction.RemoveParameterByName("case")
clsDefaultRFunction.RemoveParameterByName("minlength")
clsDefaultRFunction.RemoveParameterByPosition(7)
If rdoToLower.Checked Then
clsDefaultRFunction.AddParameter(".fn", "tolower", iPosition:=5)
clsDummyRenameWithFunction.AddParameter("checked", "lower", iPosition:=0)
Expand Down
20 changes: 10 additions & 10 deletions instat/static/InstatObject/R/data_object_R6.R
Original file line number Diff line number Diff line change
Expand Up @@ -784,20 +784,20 @@ DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", ne
} else if (type == "rename_with") {
if (missing(.fn)) stop(.fn, "is missing with no default.")
curr_col_names <- names(curr_data)
if(.fn == "abbreviate"){
if(deparse(substitute(.fn)) == "abbreviate"){
private$data <- curr_data |>
dplyr::rename_with(
.fn = .fn,
.cols = {{ .cols }},
minlength = minlength, ...
)
dplyr::rename_with(
.fn = .fn,
.cols = {{ .cols }},
minlength = minlength, ...
)
}
else{
private$data <- curr_data |>
dplyr::rename_with(
.fn = .fn,
.cols = {{ .cols }}, ...
)
dplyr::rename_with(
.fn = .fn,
.cols = {{ .cols }}, ...
)
}
new_col_names <- names(private$data)
if (!all(new_col_names %in% curr_col_names)) {
Expand Down

0 comments on commit 976f90b

Please sign in to comment.