Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for flag_paramval #14

Open
maowerner opened this issue Feb 8, 2019 · 2 comments
Open

Request for flag_paramval #14

maowerner opened this issue Feb 8, 2019 · 2 comments

Comments

@maowerner
Copy link

I would like to have a function in analogy to paramval_filter. The difference would be that instead of removing the rows where the filter condition is TRUE, it would introduce a new parameter that is TRUE or FALSE allowing to filter afterwards.

I need that for the phase shift values. We filter some points out of the Breit-Wigner fits, but plot the unfiltered data to show them as well. I want a column use_for_shift_fit which I could visualize with alpha. My current workaround is

.func <- function(param, value){
  if(
    (param$ensemble == 'A40.20' & param$total_momentum_d_sq == 3 & param$irrep == 'A1' & param$correlator_id == 2) |
    (param$ensemble == 'A40.32' & param$total_momentum_d_sq == 2 & param$irrep == 'B1' & param$correlator_id == 2) |
    (param$ensemble == 'A40.32' & param$total_momentum_d_sq == 4 & param$irrep == 'E'  & param$correlator_id == 2) |
    (param$ensemble == 'B35.32' & param$total_momentum_d_sq == 3 & param$irrep == 'A1' & param$correlator_id == 3) |
    (param$ensemble == 'B55.32' & param$total_momentum_d_sq == 3 & param$irrep == 'E'  & param$correlator_id == 1) |
    (param$ensemble == 'D15.48' & param$total_momentum_d_sq == 4 & param$irrep == 'E'  & param$correlator_id == 2) |
    (param$ensemble == 'D30.48' & param$total_momentum_d_sq == 1 & param$irrep == 'E'  & param$correlator_id == 2)
    ){
      use_for_shift_fit <- FALSE
    }
  else{use_for_shift_fit <- TRUE}

  value$use_for_shift_fit = use_for_shift_fit

  value
}

followed by

.func <- function(param, value){
  if(value$use_for_shift_fit){ NA }

  value
}
@maowerner
Copy link
Author

The second alternative would be to create a new dataframe with this additional parameter. In this case it is a hassle though because I would have to write out ~300 parameter combinations to filter out 10.

@martin-ueding
Copy link
Contributor

Is there still a need to do something here or did you get it resolved some other way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants