progress of a function...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

progress of a function...

akshay kulkarni
dear members,
                            I want to use svMisc package in R to check how my function is progressing.
It has the following syntax:

f <- function(x){ for (i in 1:1000){
                              progress (i)
                              s[i] <- sqrt(i)
                             }
                             return(i)
                           }

This gives me the progress of the function as i moves.

But what if I have mclapply function instead of the for loop? How do we get the progress of an ongoing "apply" family of functions?

Very many thanks for your time and effort...
yours sincerely,
AKSHAY M KULKARNI

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: progress of a function...

R help mailing list-2
Take a look at the pbmcapply package. It does what you need.

Marc

Le 06/07/2018 à 11:37, akshay kulkarni a écrit :

> dear members,
>                              I want to use svMisc package in R to check how my function is progressing.
> It has the following syntax:
>
> f <- function(x){ for (i in 1:1000){
>                                progress (i)
>                                s[i] <- sqrt(i)
>                               }
>                               return(i)
>                             }
>
> This gives me the progress of the function as i moves.
>
> But what if I have mclapply function instead of the for loop? How do we get the progress of an ongoing "apply" family of functions?
>
> Very many thanks for your time and effort...
> yours sincerely,
> AKSHAY M KULKARNI
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.