The future package

Found that future_lapply is better than parLapplyLB in running parallel jobs diverse in speed in Windows. 😊

It took me one afternoon to figure out how to use the future package. I heard about it but no time to learn it before. It's different from parallel because the environment in each worker is not persistent. However, this is a good thing, ensuring a consistent environment. In what I am working on, some jobs are slow and some are fast, but I can't know in advance which jobs are slow. For parLapplyLB with, say, 8 workers, if one worker is working on a slow task, all other workers still need to wait for this worker before getting the next chunk of 8 jobs. I did some tests and it seems that future_lapply, with default scheduling, will assign jobs as long as a worker is free. This is what I think load balancing should do.

The future package is a promising way to do jobs in parallel. I will take more time to learn about it.😉

R notebook

Tried R notebook and I like it.

The next time I introduce R to new users, I may go directly to R notebook and skip console, or only mention it briefly. Many people have no experience in command line interface, for good reasons. They have a hard time learning and understanding the console. Though lines are still sent to the console when running code in R notebooks, users don't really need to know what happens and can focus on the output in an R notebook. R notebook allows a work flow that encourages making analysis reproducible. It also combines planning the analysis and doing the analysis into one single place, without the hassle of iterating between script file and the output file: render the markdown file, check the output, revise and re-render, check, and so on.


An interesting package! I am going teach lavaan this semester. I will try it first and may introduce it to my student. I still think writing and running script is the most efficient work flow. However, a shiny-based interface may be good for learning and testing.

Source windows in RStudio

Link: Using Source Windows (@ RStudio Support)

A good feature! Some users like one single window with panes. Some users like multiple windows. Some users like being able to choose.

I like the interface of GIMP, in which you can switch between single and multiple window modes. I also like the interface of Blender, in which you can work in one window with panes, as in RStudio, or you can work in multiple windows, which can also have mroe than one pane each, just by creating new windows.

I hope RStudio can be more flexible. I don't like the the single window mode when working on a small screen notebook.