Forums | OpenR
OpenR: R & Statistics
/
Guest Lecture by Dr. Yihui Xie
14 April 2022, 10:35 AM
Dr. Yihui Xie is invited to give us an online lecture about statistics/R. ten tips on using R Markdown. Finally, he'll teach us how to create a personal
What else would you like to hear? Please list your wishes in a reply to this post. Either in English or in Chinese. Yihui will see your wishes. May your wishes come true.
- Time: Saturday, May 14th, 10:00 -12:00 (Beijing Time).
- Online platform: Zhumu
Topic: Ten Tips on R Markdown, and Creating Your Personal Website with R Markdown
Outline:
-
-
-
Have a account
-
-
Create animations with R (20min)
-
(ship traces in 18th century)
-
-
How it works (live code: draw random points on a plot)
-
(Brownian Motion)
-
(BM within a circle)
-
()
-
(Bisection method)
-
(Central Limit Theorem)
-
(Quincunx)
-
-
Other packages
-
()
-
-
-
Conclusion: have fun!
-
-
(50min)
-
Live preview via
xaringan::inf_mr()
-
A quick introduction to , and how to customize HTML output via CSS and JavaScript
-
Create animations via
-
Export R script from R Markdown via
-
Convert R script to R Markdown via
-
Embed files via
-
via the chunk option
ref.label
and<<>>
-
Read external code into a code chunk via
-
Reformat R code via
-
Exit knitting early via
-
-
Creating your personal website via (30min)
-
Three possible themes: (minimal/simple), (intermediate), (sophisticated)
-
Set your Git credentials
xfun::pkg_load2('usethis')
usethis::create_github_token()
gitcreds::gitcreds_set() -
Create a Github repo for your website, and connect it to or
usethis::use_git()
usethis::use_github()
-
-
Introduction to Dr. Yihui Xie
PhD at the Department of Statistics, Iowa State University.
In 2006, Yihui founded the Capital of Statistics, which has grown into a large online community on statistics in China. He initiated the Chinese R conference in 2008, and has been organizing R conferences in China since then. During his PhD training at the Iowa State University, he won the Vince Sposito Statistical Computing Award (2011) and the Snedecor Award (2012) in the Department of Statistics.
Yihui is the author/co-author of many popular R packages, including knitr, bookdown, blogdown, xaringan, tinytex, rolldown, animation, DT, tufte, formatR, fun, xfun, mime, highr, servr, and Rd2roxygen, shiny, rmarkdown, rticles, leaflet, etc..
Yihui has published the following books:
- R Markdown: The Definitive Guide
- R Markdown Cookbook
- Dynamic Documents with knitr
- bookdown: Authoring Books and Technical Documents with R Markdown
- blogdown: Creating Websites with R Markdown
- Modern Statistical Graphs (in Chinese)
Official page: https://www.rstudio.com/authors/yihui-xie/
Personal blog:
Edits to this post:
-
Peng Zhao - 14 April 2022, 5:04 PM
-
Peng Zhao - 14 April 2022, 5:57 PM
-
Peng Zhao - 14 April 2022, 8:00 PM
-
Peng Zhao - 18 April 2022, 4:15 PM
-
Peng Zhao - 22 April 2022, 5:17 PM
-
Peng Zhao - 13 May 2022, 10:38 AM
-
Peng Zhao - 13 May 2022, 1:41 PM
-
Peng Zhao - 14 May 2022, 8:33 PM
-
Peng Zhao - 15 May 2022, 6:50 AM
-
Peng Zhao - 15 May 2022, 6:59 AM
-
Peng Zhao - 19 May 2022, 10:11 AM
14 April 2022, 7:53 PM
My wish list:
- How should a non-statistics student learn and use statistics or the R language?
- How can we use statistics and the R Markdown tools in reproducible research?
- What role does statistics/R language play in the students' future career development?
16 April 2022, 4:46 PM
My wish list:
- What will be the next step for statistician to go/improve/develop , on the perspective of subversive revolution?
- To what extent do we need to understand the background of maths behind statistics for different purpose in career?
- What is the trend of R studio in the future, in what aspects will it be more competitive rather than other languages? What is the weekness of R studio that we need to pay attention to if there will be?
17 April 2022, 2:07 PM
My wish list:
- How the researchers create a new model or a new parameter to describe the data? e.g.: the population variation of a species, biodiversity indices.
- If I want to create a new model to discribe a pattern of a kind of data, what advanced math knowledge should I learn?
- When I read the literiture, I found that there are many kinds of statistical mathods which I have not learnt. Do I have chances to learnt them systematically in master or PhD program? If not, how should we learn these relative new statistical methods?
18 April 2022, 5:11 PM
Dr. Yi Zou asks: Could you recommend several books (or other articles, websites) about
1. The median and advanced R programming(tips or learning strategy)
2. General rules about R functions (e.g. make the function concise)
14 May 2022, 2:11 PM
Some useful links from the Q&A:
- kableExtra package: https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html
- tables in R Markdown: https://bookdown.org/yihui/rmarkdown-cookbook/tables.html
- Quarto: https://yihui.org/en/2022/04/quarto-r-markdown/
15 May 2022, 12:03 PM
Yihui sent me his answers to some questions that he had no time to answer during the lecture:
-
How should a non-statistics student learn and use statistics or the R language?
-
I feel that finding a problem in which you are truly interested is much more important than a specific technology or methodology (more at https://yihui.org/en/2018/08/influence-depth-or-breadth/). For example, I started with R graphics and animations.
-
-
What will be the next step for statisticians to go/improve/develop, on the perspective of subversive revolution?
-
I think subversive revolutions are rare, and I also wish I could know what the "next step" is. I'd recommend that you aim at "tiny wins" first (The Power of Small Wins: https://hbr.org/2011/05/the-power-of-small-wins).
-
-
What is the trend of RStudio in the future, in what aspects will it be more competitive rather than other languages? What is the weakness of RStudio that we need to pay attention to if there will be?
-
I'd rather use the word "collaborative" than "competitive", e.g., RStudio has been adding more and more support for languages and tools beyond R (in particular, Python and Jupyter). I think RStudio Cloud will be a flagship product of RStudio that gives you a platform on which you can write documents or programs in different languages.
-
Regarding the weakness of RStudio, I'm not sure. I'm a little concerned about RStudio becoming a monopoly in the R world. We have seen controversies and debates on RStudio's tools vs other tools from the rest of the R community. These debates often lack data evidence, so personally, I don't really know if our tools or ideas are better.
-
-
If I want to create a new model to describe a pattern of a kind of data, what advanced math knowledge should I learn?
-
I don't understand the fantasy over "new models" or "advanced math". I'm very pragmatic---whatever model works is a good model. It doesn't have to be new or advanced or complicated. That said, I totally understand that sometimes people in academia need to survive by making things overly advanced and complicated. Sorry about my cynicism.
-
-
When I read the literature, I found that there are many kinds of statistical methods which I have not learned. Do I have a chance to learn them systematically in the master or Ph.D. program? If not, how should we learn these relatively new statistical methods?
-
I'd suggest that you find a good collaborator from statistics, instead of making yourself a Ph.D. in statistics. I think it may be a good idea to co-major in statistics to get a master's degree, though.
-
-
The intermediate and advanced R programming (tips or learning strategy)
-
I have rarely finished reading any book on R, and I learned R mostly from its help pages: https://yihui.org/en/2017/12/how-i-learned-r/ Actually I don't think you have to master advanced R programming techniques to be able to create something useful. I have never considered myself an advanced R programmer. I just happen to be able to find interesting problems to solve, and these problems don't often require any advanced techniques.
-
In terms of learning strategies, one suggestion that I have for you is to keep taking notes while you are learning. Having a personal website to write blog posts is absolutely a good idea.
-
-
General rules about R functions (e.g. make the function concise)
-
This requires a lot of practice. You must write a lot of "bad code" before you can write nice or concise code. One skill that I have found important is to refactor code, or put it another way, abstraction. That is, when you find yourself repeating some code, it's almost always a good time to factor out these code into an
-