The Four Pipes of magrittr

[This article was first published on R on Data & The World, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. The magrittr package is a part of the … Read more

Categories R Tags ExcerptFavorite

My Excel and R Journey in Financial Services

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Photo by Clay Banks on Unsplash RStudio is dedicated to our mission … Read more

Categories R Tags ExcerptFavorite

RSwitch 2.1.2b Bug-fix Release

[This article was first published on R – rud.is, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. RStudio is continuing to refine their new product version string scheme, … Read more

Categories R Tags ExcerptFavorite

Geocomputation with R: Second Edition feedback

TL;DR: Please help us by filling out the survey at https://forms.gle/nq9RmbxJyZXQgc948. It’s been almost 3 years since the first edition of Geocomputation with R was published back in 2019. It’s been an amazing journey for this open source book on geographic data analysis, visualization and modeling since then. We have reached almost 500k people via … Read more

Categories R Tags ExcerptFavorite

Testing rounded data for a circular uniform distribution

[This article was first published on The Shape of Code » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Circular statistics deals with analysis of measurements made … Read more

Categories R Tags ExcerptFavorite

Mistakes: You’ll make a few

Running into errors and warnings is a completely normal part of programming – even the best of the best can count on it happening daily! Getting comfortable with what the errors mean and how to find the solution is part of your learning journey. Here’s a checklist (pdf /jpg) with some common errors you’ll encounter. … Read more

Categories R Tags ExcerptFavorite

Pre-Commit Hook for Processing README.Rmd

[This article was first published on R | datawookie, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. When writing an R package I usually write a README.Rmd file … Read more

Categories R Tags ExcerptFavorite

Speedrunning row-oriented workflows

If you haven’t, you should read this first. This is part two. Speedrunning is the… hrm… – sport? art? – of playing games from start to finish as fast as possible. Speedrunning requires an insane amount of knowledge of the game being played, as well as an enourmous amount of skill. Also, contrary to what … Read more

Categories R Tags ExcerptFavorite

Simulation Smoother using RcppArmadillo

[This article was first published on Rcpp Gallery, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Simulation smoothing involves drawing latent state variables in discrete-time state–space models from … Read more

Categories R Tags ExcerptFavorite

Sample Size Calculation and Power Clinical Trials

[This article was first published on Methods – finnstats, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Sample Size Calculation and Power, One of the most important stages … Read more

Categories R Tags ExcerptFavorite

The quest for fast(er?) row-oriented workflows

The past few weeks I have been exploring the speed of R. It started with this video in which I explained that R is not necessarily slower than any other interpreted language, as long as you’re using the built-in, optimized functions. However should you write your own implementation of an algorithm, especially if that algorithm … Read more

Categories R Tags ExcerptFavorite

Climate circles

Predefinitions We define a divergent vector of various hues. col_temp <- c(“#cbebf6″,”#a7bfd9″,”#8c99bc”,”#974ea8″,”#830f74″, “#0b144f”,”#0e2680″,”#223b97″,”#1c499a”,”#2859a5″, “#1b6aa3″,”#1d9bc4″,”#1ca4bc”,”#64c6c7″,”#86cabb”, “#91e0a7″,”#c7eebf”,”#ebf8da”,”#f6fdd1″,”#fdeca7″, “#f8da77″,”#fcb34d”,”#fc8c44″,”#f85127″,”#f52f26″, “#d10b26″,”#9c042a”,”#760324″,”#18000c”) We create a table with the x-axis grid lines. grid_x <- tibble(x = seq(ymd(“2000-01-01”), ymd(“2000-12-31”), “month”), y = rep(-10, 12), xend = seq(ymd(“2000-01-01”), ymd(“2000-12-31”), “month”), yend = rep(41, 12)) We define all the style elements of the graph … Read more

Categories R Tags ExcerptFavorite

Covid Trajectories

[This article was first published on R on kieranhealy.org, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. I updated the covdata package for the first time in a … Read more

Categories R Tags ExcerptFavorite

An Integrated Method for Estimation and Optimisation

[This article was first published on R – Open Forecasting, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. My PhD student, Congzheng Liu (co-supervised with Adam Letchford) has … Read more

Categories R Tags ExcerptFavorite

A technical interview question

[This article was first published on R – scottishsnow, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. I was browsing #rstats on Twitter recently and came across this … Read more

Categories R Tags ExcerptFavorite

Bond Modified Duration in R

#========================================================# # Quantitative ALM, Financial Econometrics & Derivatives  # ML/DL using R, Python, Tensorflow by Sang-Heon Lee  # # https://kiandlee.blogspot.com #——————————————————–# # Bond Modified Duration Calculation #========================================================# graphics.off()  # clear all graphs rm(list = ls()) # remove all files from your workspace #——————————————————- # Input #——————————————————-     C  – 0.05       # coupon rate     y  – 0.03       # YTM     m  – 5          # maturity     dr – 0.000001   # interest rate change #——————————————————- # Duration by Definition (k=1) #——————————————————-          # data.frame for calculation     df – data.frame(T = 1:m,                       CF = C + c(0,0,0,0,1))          df$DF – 1/(1+y)^(df$T)     df$DC – df$DF*df$CF          P0 – sum(df$DC) # initial bond price          df$TDC – df$T*df$DC # time * discounted CF          STDC – sum(df$TDC)          # duration     D_mac_dk1 – STDC/P0         # Macaulay Dur     D_mod_dk1 – D_mac_dk1/(1+y) # Modified Dur      #——————————————————- # Duration by Numerical Differentiation (k=1) #——————————————————-          df – data.frame(T = 1:m,                       CF = C + c(rep(0,m–1),1))          df$DFu – 1/(1+y–dr)^(df$T)     df$DCu – df$DFu*df$CF          Pu – sum(df$DCu) # price up          df$DFd – 1/(1+y+dr)^(df$T)     df$DCd – df$DFd*df$CF          Pd – sum(df$DCd) # price down      … Read more

Categories R Tags ExcerptFavorite

A way of creating clear, transparent, and unified data visualizations

How to create appropriate data visualizations using tidycharts package. There is a wide range of R packages created for data visualization, but still, something was lacking. There was no simple and easily accessible way to create clean and transparent charts — up to this day! tidychartsguarantees that your charts will be appropriate and consistent with each other. … Read more

Categories R Tags ExcerptFavorite

rOpenSci docs are now built on r-universe

This post is part of a series of technotes about r-universe, a new umbrella project by rOpenSci under which we experiment with various ideas for improving publication and discovery of research software in R. As the project evolves, we will post updates to document features and technical details. For more information, visit the r-universe project … Read more

Categories R Tags ExcerptFavorite

{emayili} Interpolating Message Content

A small new feature added to {emayili}: the ability to interpolate content into the email message body. Load Package Load the {emayili} package and create a message skeleton. library(emayili) options( # Always print message body. envelope_details = TRUE, # Print message from pipeline. envelope_invisible = FALSE ) # Create a message skeleton. # email <- … Read more

Categories R Tags ExcerptFavorite

PDF editing

[This article was first published on R – scottishsnow, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. I had to produce a pdf report at work this week. … Read more

Categories R Tags ExcerptFavorite

Hosting Shiny Apps with ShinyProxy: a Review

[This article was first published on R – Hosting Data Apps, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. ShinyProxy comes with free enterprise features, such as authentication … Read more

Categories R Tags ExcerptFavorite

Basic R : Read so many CSV files

#========================================================# # Quantitative ALM, Financial Econometrics & Derivatives  # ML/DL using R, Python, Tensorflow by Sang-Heon Lee  # # https://kiandlee.blogspot.com #——————————————————–# # Basic R : read all csv files when these are so many #========================================================# graphics.off()  # clear all graphs rm(list = ls()) # remove all files from your workspace # working directory setwd(“D:/SHLEE/blog/R/many_csv”) # directory where csv files are located path– file.path(getwd()) #——————————————————- # make a list of all file names with csv or txt ext. #——————————————————- # $         : end of file name # (csv|txt) : multiple file extentions # \\.       : avoid unwanted cases such as .ccsv #——————————————————- v.filename – list.files(path, pattern=“\\.(csv|txt)$”,                           ignore.case = TRUE,                           full.names = FALSE) #——————————————————- # Test 1) read and make each data.frame #——————————————————- for(fn in v.filename) {          df.each = read.csv(fn)          print(fn); print(df.each) } #——————————————————- # Test 2) read and collect into one data.frame #——————————————————- df.all = do.call(rbind, lapply(v.filename,                                 function(x) read.csv(x))) print(df.all) Favorite

Categories R Tags ExcerptFavorite

Weibull Distribution in R

[This article was first published on Methods – finnstats, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Weibull Distribution in R, Weibull Distribution was discovered by Swedish physicist … Read more

Categories R Tags ExcerptFavorite

Bayesian Regression Analysis with Rstanarm

[This article was first published on Method Matters Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. In this post, we will work through a simple example of … Read more

Categories R Tags ExcerptFavorite

R user or R Developer? The survey results

[This article was first published on Mirai Solutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. We asked this question to the Community and are now ready to … Read more

Categories R Tags ExcerptFavorite

How to Make Production Ready Shiny Applications

What defines a production-ready Shiny application? And more importantly, how do we get there? Shiny is hands down one of the best dev tools available for quick production of Proof of Concepts (PoC). But here in lies a trap. People tend to mislabel Shiny as a poor production tool because they fall for the PoC … Read more

Categories R Tags ExcerptFavorite

How to confuse your shareholders by bad data visualization

Like many people during the COVID19 crisis, I turned to the stock market as a new hobby. Like the ignorant investor that I am, I thought it wise to hop on the cloud computing bandwagon. Hence, I bought, among others, a small position in Rackspace Technologies. A long way down Now, my Rackspace shares have … Read more

Categories R Tags ExcerptFavorite

{gitlabr} v2.0 is on CRAN!

[This article was first published on Rtask, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. You can read the original post in its original format on Rtask website … Read more

Categories R Tags ExcerptFavorite

Subgroup analysis using a Bayesian hierarchical model

[This article was first published on ouR data generation, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. I’m part of a team that recently submitted the results of … Read more

Categories R Tags ExcerptFavorite

rOpenSci News Digest, August 2021

Dear rOpenSci friends, it’s time for our monthly news roundup! You can read this post on our blog. Now let’s dive into the activity at and around rOpenSci! 🔗 rOpenSci HQ 🔗 Recordings of useR! 2021 Recordings of useR! 2021 are now available on the conference website. You can watch contributions by rOpenSci staff: And … Read more

Categories R Tags ExcerptFavorite

A Latin American R community for HR

[This article was first published on R Consortium, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. By Sergio Garcia Mora R4HR, formerly known as the Club de R … Read more

Categories R Tags ExcerptFavorite

ShinyProxy 1-click App

[This article was first published on R – Hosting Data Apps, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. ShinyProxy is one of the most popular options to … Read more

Categories R Tags ExcerptFavorite

RStudio Connect 2021.08.0 Custom Branding

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Many organizations want to align RStudio Connect with their branding strategy. Whether … Read more

Categories R Tags ExcerptFavorite

RStudio Connect 2021.08.0 Python Updates

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. At RStudio we know that many data science teams leverage both R … Read more

Categories R Tags ExcerptFavorite

R : a combined usage of split, lapply and do.call

#————————————————– # 5) Multiple output with multiple key columns #    while original row is preserved #————————————————–          # outer lapply     lt.out  – lapply(                   # split by currency for outer lapply         split(df.data, df.data$currency ),          function(x){                          # inner lapply             y – lapply(                                  # split by maturity for inner lapply                 split(x, x$maturity),                  function(x) {                     data.frame(curr = x$currency,                                mat  = x$maturity,                                ws   = x$ws,                                sum_ws = sum(x$ws))})             # concatenate inner rows             do.call(rbind,y)         })          # concatenate outer rows     df.out – do.call(rbind,lt.out)      rownames(df.out) – NULL          # add another group based calculation     df.out$group_wgt – df.out$ws/df.out$sum_ws     print(df.out)    ––––––––––––––––––––––––––––––––––––––––––––––––––– >     print(df.out)       curr mat         ws     sum_ws group_wgt 1   AUD  2y  106000000  320000000 0.3312500 2   AUD  2y  214000000  320000000 0.6687500 3   AUD  6m  213000000  213000000 1.0000000 4   CNY  6m   84000000  270000000 0.3111111 5   CNY  6m   42000000  270000000 0.1555556 6   CNY  6m  144000000  270000000 0.5333333 7   EUR  1y  250000000 2105000000 0.1187648 8   EUR  1y 1855000000 2105000000 0.8812352 9   EUR  3m 1785000000 1785000000 1.0000000 10  EUR  6m  200000000  200000000 1.0000000 11  USD  1y  112000000  112000000 1.0000000 12  USD  2y   56000000   56000000 1.0000000 13  USD  3m  285000000  741000000 0.3846154 14  USD  3m  456000000  741000000 0.6153846 Favorite

Categories R Tags ExcerptFavorite

Exploring Stock Market Listing Mortality since 1986

[This article was first published on R on Redwall Analytics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Click to see R set-up code # Libraries if(!require(“pacman”)) { … Read more

Categories R Tags ExcerptFavorite

How to Perform Tukey HSD Test in R

[This article was first published on Methods – finnstats, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Tukey HSD Test in R, When there are three or more … Read more

Categories R Tags ExcerptFavorite

Detecting time series outliers

[This article was first published on R on Rob J Hyndman, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. The tsoutliers() function in the forecast package for R … Read more

Categories R Tags ExcerptFavorite

Shiny UI & UX With Short Live Coding Tutorial

A Shiny UI It’s often said that if you don’t remember the experience of using an app or website, that’s a good thing. When a good app presents an experience that is seamless, users breeze right through. But at Appsilon we want our users to be conscious of the Shiny UI and their experience – … Read more

Categories R Tags ExcerptFavorite

How to Perform Dunnett’s Test in R

[This article was first published on Methods – finnstats, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Dunnett’s test in R, After the ANOVA test has been completed … Read more

Categories R Tags ExcerptFavorite

Win a free training course for you and your colleagues !

We are launching a competition to celebrate the Enterprise Applications of the R Language Conference taking place from the 6-10th of September 2021. You have the chance to win a 2-day training course for you and up to 9 other attendees from your company. The winner can select either ‘Intro the R for analytics’ or … Read more

Categories R Tags ExcerptFavorite

Comparing SQLite, DuckDB and Arrow with UN Trade Data

[This article was first published on Pachá, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. This is not a competition, is just to show how to use the … Read more

Categories R Tags ExcerptFavorite

How to Host Shiny Apps on Heroku: a Review

[This article was first published on R – Hosting Data Apps, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t. Any app at any scale: use one of the … Read more

Categories R Tags ExcerptFavorite

EARL Online 2021: Dr Branka Subotić, keynote speaker

The opening keynote at the Enterprise Applications of the R Language Conference presentation day will be Dr Branka Subotić. Branka has over 15 years of experience in the aviation industry and she has worked for NATS for 12+ years. Branka will be joining Jacqueline Nolis as our second keynote speaker at EARL. The presentation day … Read more

Categories R Tags ExcerptFavorite