How to migrate R software-based program to SPA?

I have a program that is based on R software to get a glicko analysis.

enter image description here

The program requires some packages like RPostgres and stringr to manage the database connection, and also dbplyr, tidyverse, playerRatings, ggplot2, GGally.

I am trying to migrate this kind of program over to a JavaScript-based one like Vue or React using highcharts.

It is my first time touching R software, so I am feeling very difficult to read the lines.

I don’t feel any difficulties with DB management or SQL queries used in the R program, but the most difficult thing is to read R software libraries and the functions.

tmp <- glicko2(subdat %>% 
                 filter(class == "5th") %>%
                 select(Week,Person,Question,Score), 
               status = questions %>% rename(Player = Question))$ratings %>%
  select(Player,Rating,Deviation,Volatility) %>%
  filter(str_starts(Player,"p_")) %>%
  rename(Person = Player)

Is there any way to integrate the R software directly in an SPA without updating the code or how can I migrate it over to SPA easily?