Stack Overflow is a great source of information to get ideas on how to improve our R code. In this episode of Code Club, Pat will walk through how he uses suggestions from Stack Overflow to integrate the ideas into his own code. Surprisingly, for dividing a matrix by a vector he gets slightly different results from what was shown on Stack Overflow underscoring the value of doing your own benchmarking and profiling. This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.
If you want to get a physical copy of R Packages: [ Ссылка ]
If you want a free, online version of R packages: [ Ссылка ]
You can find my blog post for this episode at [ Ссылка ].
Check out the GitHub repository at the:
* Beginning of the episode: [ Ссылка ]
* End of the episode: [ Ссылка ]
#rstats #paste #paste0 #refactor #testthat #tdd #microbenchmark #vectors #rdp #16S #classification #classifier #microbialecology #microbiome
Support Riffomonas by becoming a Patreon member!
[ Ссылка ]
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at [ Ссылка ] to get practice problems, tips, and insights.
If you're interested in purchasing a video workshop be sure to check out [ Ссылка ]
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: [ Ссылка ]
General data: [ Ссылка ]
0:00 Introduction
3:51 Double transposing matrix
8:09 Stack Overflow
11:47 Matrix multiplication
15:00 Using sweep function
17:52 Using rep function
21:14 Using replace function
24:05 Using col function
26:40 Benchmarking considerations
28:09 profvis results revisited
Ещё видео!