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

How to use big_apply properly #175

Open
minhnd212 opened this issue Mar 11, 2024 · 4 comments
Open

How to use big_apply properly #175

minhnd212 opened this issue Mar 11, 2024 · 4 comments

Comments

@minhnd212
Copy link

Hi, I wish to use the big_apply() function in the same manner as apply(). I went through the function's documentation and noticed that big_apply() applies to an a.FUN that calls another function that can perform calculations on a GROUP of columns, such as colSums(), rowSums(), etc., and which group of columns to be calculated are based on the ind argument.

However, my a.FUN calls another function that can perform calculations on ONE column at a time only (instead of a group of columns). I can program the function so that it can perform calculations on a group of columns by using a for loop, but then it defeats the purpose of using big_apply() or apply(), which is to avoid using the for loop, if I understand correctly.

Could you give me a suggestion on how I can go about solving this problem? Thank you.

@privefl
Copy link
Owner

privefl commented Mar 11, 2024

  • First, apply() is nothing but a for loop as well
  • If apply() works for you, then you can apply it on X[, ind, drop = FALSE].

@minhnd212
Copy link
Author

I am sorry for the late reply. I ran into the same problem that I wrote in the other post, which is to use the big_apply() function properly, so if I can get some more details on how to write the big_apply() function properly for what I am trying to do, I believe this issue will be resolved as well. Thank you

@privefl
Copy link
Owner

privefl commented Mar 17, 2024

Please share what you've tried with big_apply(), we'll go from there.

@privefl
Copy link
Owner

privefl commented Apr 12, 2024

Any update on this?

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