Handbook on photobiological calculations with R

Book coverA handbook on how to do calculations used in photobiological research with R has been under preparation for a long time. An  80% complete version has been available through LeanPub for several years. The book describes the use of our suite of R packages and also of functions from base R and a few other packages available through CRAN. I (Pedro J. Aphalo) am the lead author, while Andreas Albert, T. Matthew Robson and Titta Kotilainen have contributed text and examples and feedback.

Although we haven’t had time to finish writing the book, I have been checking that the code examples work with current versions of R and packages. Rather recently I made small edits to a few code chunks that had stopped working and uploaded the new version of the PDF file to LeanPub.

Some minutes ago I tried to build all examples with R 4.2.o, a major update to R released some days ago. R 4.2.o contains a bug, that unluckily prevents a couple some examples in the book from running under MS-Windows. The already available patched version of R 4.2.0 solves this problem. Anyway, this bug affects only a very specific use related to data acquisition.

The book is sold for the amount the buyer wishes to pay, including getting it for free.

learnrbook 1.0.2

Package documentation web site at: https://docs.r4photobiology.info/learnrbook/

This is the second version submitted to CRAN for the book as published in the R Series.

This update adds .R files with the code from all chunks in the book, including a few not visible. There are some small edits to the documentation.

NOTE: The updated package is on its way to CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://github.com/aphalo/learnrbook-pkg/issues

 

learnrbook 1.0.1

Package documentation web site at: https://docs.r4photobiology.info/learnrbook/

This is the first version submitted to CRAN for the book as published in the R Series.

Versions starting from 1.0.0 are for the book as published in the R Series. Earlier versions were for various partial drafts of the book, as pre-published through LeanPub. The book was published a few of weeks ago, but shipping has started in the last few days.

NOTE: The updated package is on its way to CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/learnrbook-pkg/issues

Word cloud figure from LaTeX index entries

I created the word cloud on the cover of “Learn R as a Language” using an R script that takes as input the file for the book index, as generated when creating the PDF from the LaTeX source files. This input file contained quite a lot of additional information, like font changes and page numbers that needed to be stripped into a clean list of words. Only later I realized that it would have been easier to produce a cleaner word list to start with. So, I first present the code revised to work with a simpler word list. This is actually tested with the book files to work. If you want to do something similar for your own book, follow the revised code in first section below. If you want to see the “hacked-up” code I really used for the cover as included in the book, it is in the second section below.

Continue reading

Learn R: As a Language

Image of the book cover

ISBN 9780367182533

My book on R was published on 28 July 2020. The R package ‘learnrbook’ available through CRAN contains data and the R code scripts and chunks from the book. The book has now its own website.

In the book’s website you will find free supplementary chapters as downloadable PDF files and other material complementing the book.

[2022-06-24] Last week I started updating the book manuscript for a 2nd printing/edition. For the time being I have been adding several diagrams and flow charts, expanding the text to improve clarity and fixing all typos in text and code that I am aware of. I am also addressing the new features in R 4.2.0 and changes to the packages used in the examples. Please, do share with me anything you would like changed from the current edition and report any mistakes you may have found. All useful contributions will be acknowledged. Thanks in advance!

[2022-08-14] You may think that learning the ‘tidyverse’ could be enough. My experience tells it is not, and that a good understanding of the R language keeps one out of trouble even when using the ‘tidyverse’. I came accross an old post by Joel Spolsky that explains why this is the case in general: higher levels of abstractions “leak”, abstractions are imperfect, and the underlying complexity seeps through. With respect to R and the ‘tidyverse’, the evolving paper on Teaching R in a Kinder, Gentler, More Effective Manner by Norm Matloff is very clear about this.

[2022-08-24] The book has been listed as a “2021 CHOICE Outstanding Academic Title Award Winner” which makes me very happy and encourages my work on a 2nd edition.

Book and package: Learn R …as you learnt your mother tongue

Book cover

Book cover

Book draft of 2017-05-14 and ‘learnrbook’ package 0.0.2.

My book titled Learn R …as you learnt your mother tongue is gradually approaching completion, but the text is not yet polished. Today’s milestone is that the first version of the companion R package has been accepted for distribution through CRAN.

In the draft version I uploaded today, published as earlier ones through Leanpub, approximately 95% of the book content is included. Today’s version differs from earlier ones in that as now the original datasets and files used in examples are now in package ‘learnrbook’, the example code has been edited to make use of it. The package is since yesterday in CRAN. The updated version of the book also tracks improvements in version 0.2.15 of my package ‘ggpmisc’, which is since today in CRAN.

The PDF of this updated draft of the book is available at http://leanpub.com/learnr for whatever price you would like to pay for it (including for free). However, paying even as little as 1€ for your copy would go a long way towards supporting the expenses of running this web site.

Book: Learn R …as you learnt your mother tongue

Book cover

Book cover

Draft of 2017-03-26

My book titled Learn R …as you learnt your mother tongue is nearly complete, but the text is not yet polished.

In the fifth draft version, published through Leanpub, approximately 95% of the book content is included.

The PDF of this updated draft of the book is available at http://leanpub.com/learnr for whatever price you would like to pay for it (including for free). However, paying even as little as 1€ for your copy would go a long way towards supporting the expenses of running this web site.

Status as of 2017-03-26. Except for the chapter on data manipulation, all chapters are close to their final form.

Draft of 2017-04-08

Two updates released to Leanpub on 4 April and 8 April, respectively. Chapter on data manipulation is now complete but text is still is rather rough.

Draft of 2017-04-14

More updates to file at Leanpub. Indexing of functions is mostly done. Polishing of text and code examples has started. A few additional code examples added. R package containing original data used in examples in the book is nearly ready for first release.

 

Book: Learn R …as you learnt your mother tongue

Book cover

Book cover

Draft 004

I have pre-published my notes on R as a future book at Leanpub titled Learn R …as you learnt your mother tongue.

In the fourth draft version, published through Leanpub, approximately 85% of the book contents are included.

The PDF of this updated draft of the book is available at http://leanpub.com/learnr for whatever price you would like to pay for it (including for free).

Status as of 2017-02-09. Wrote section on ggplot2 themes, and on using system and Google fonts in ggpplots with the help of package ‘showtext’. Expanded section on ‘ggplot2’’s annotation , and revised some sections in the “R scripts and Programming” chapter. Started writing the data chapter. Wrote draft on writing and reading text files. Several other smaller edits to text and a few new examples.

Draft [2017-02-15]

Completed first part of data chapter including importing data from files in different formats and on reading files or web pages from the internet.

Book: Learn R …as you learnt your mother tongue

Book cover

Book cover

Draft 003

I have pre-published my notes on R as a future book at Leanpub titled Learn R …as you learnt your mother tongue.

In the third draft version, published through Leanpub, approximately 85% of the book contents are included.

The PDF of this updated draft of the book is available since this morning at http://leanpub.com/learnr for whatever price you would like to pay for it (including for free).

Status as of 2017-01-17: Added “playground” exercises to the chapter describing ‘ggplot2’, and converted some of the examples earlier part of the main text into these playground items. Added icons to help readers quickly distinguish playground sections, information sections, warnings about things one needs to be specially aware of and boxes with more advanced content. Added to the sections scales and examples in the ‘ggplot2’ chapter details about the use of colors in R and ‘ggplot2’ 2. Removed some redundant examples, and updated the section on plotmath . Added terms to the alphabetical index. Increased line-spacing to avoid uneven spacing with inline code bits.

How to be a modern scientist by Jeffrey Leek [Leanpub]

A book on how to be a scientist the modern way.

Source: How to be a modern… by Jeffrey Leek [Leanpub PDF/iPad/Kindle]

Book cover image

This book looks very useful for PhD students and also to some extent for more experienced researchers willing to get up-to-speed with the use of modern communication tools and on-line media and forums.

It covers a lot of subjects concisely and is very up-to-date. It is an easy read but full of useful information and ideas.

The e-book has a suggested price, but you can chose to get it for free or pay less if you are on a tight budget. Payment is fully voluntary, so you can also pay more than the suggested price if you want to support the author.

 

Outliers (successful people)

I was visiting Buenos Aires for a few weeks. I had two flights lasting more 12 h and took advantage of the time to read a very interesting book. I am no expert on the subject, and the book is written for general public by a reporter. Following what, I think, is a common approach in humanities, the text is structured around case studies of the careers of well-known successful people like Bill Gates and obscure unsuccessful people who had all the features that are usually assumed to lead to success in business, science or arts. The book is very well written and engaging, but in a way that encourages the reader to think and reach his/her own conclusions before the author reveals his own ideas.

The overall message is that the circumstances allow the outliers to achieve success. That because of the way teaching, sports, and other activities are scheduled and  organized things as simple as the birth date can constrain in what activities we can be successful in.

The interesting message is that in many cases simple changes to how we select students, teach, etc. could improve the chances for more people to succeed in life. This made me ponder about my own career path and reinforced my view that I am where I am because of taking advantage of the opportunities that came along the way rather than by having had a well defined career plan from the very beginning.

To some extent this book links to the my earlier post on career paths and specialists vs. generalists.

The full reference to “Outliers” is:

Gladwell, Malcolm (2009) Outliers: the story of success. London New York: Penguin Books, 320 pp, ISBN 9780141036250.