Category "r"

How to use fairseq's Megatron in r-text?

I am using R 4.1.2, reticulate 1.22 and text 0.9.50. # install.packages("devtools") devtools::install_github("oscarkjell/text") library(text) temp <- textEmb

How to combine all datasets into a data frame after multiple imputation (mice)

I read this article (https://journal.r-project.org/archive/2021/RJ-2021-073/RJ-2021-073.pdf) about multiple imputation and propensity score matching - here is t

Scraping two-column PDF

I try to scrape the texts of hundreds of PDFs for a project. The PDFs have title pages, headers, footers and two columns. I tried the packages pdftools and tabu

Is there any way to include time-varying variables in CoxBoost or GLMBoost?

I am currently struggling with the following problem in R: I would like to use a Cox model with time-varying variables to perform my variable selection via boos

R - networkD3 issues

I am using networkD3 in R to display my data (sankeyNetwork function). I ran into several issues that do not seem to have solutions available. Issue 1: If node

How to escape single quote in Flexdashboard Navbar Menu?

I'm using R markdown to create a flexdashboard. I'm having difficulty escaping a single quote in the title of one of my navbar menus. I would like for my menu t

How can I plot the intercept and coefficient of my LMM with 95% confidence interval over spagetti plots in R?

To visualize the results of my linear mixed model (LMM) I would like to plot spagetti plots that track the change in volume1 over time for all participants. I w

Bulk downsampling list of wave objects using seewave::resamp

I am trying to downsample a list of wave objects using seewave::resamp. To get my list I have imported a .wav file and split it into 10 second clips following @

Reiterative calculate

I have to make a reiterative table that each calculation has to take the previous one. Let me explain, my initial data are: maximum <- 10 minimum <- 2 ord

classify audio data based on thresholding in R

I have a number of audio files (~5 minutes long). All I need to do is to detect whether someone is speaking or not. It is only one speaker in each file, but the

R Plotly Bar Chart - Add horizontal line markers

I want to draw a bar chart with two bars side by side for each category (LETTERS) and add a horizontal line to each bar (y_ref as red lines & z_ref as green

How to set size of rpivotTable in rmarkdown document

I would like to include several rpivotTables in an rmarkdown HTML output (document, flexdashboard, other options that result in a standalone HTML file are ok; I

dplyr mutate only works once

I'd like to add a new variable to a dataframe for plotting labels, as seen in the top voted answer here Here's the data: small <- structure(list(Site = stru

Tibetan characters in data.frames cannot be displayed in R console even after locale is set (Chinese is fine, Tibetan in matrices is fine)

In R, Tibetan characters do not display properly when they are located in data.frames: > Sys.setlocale("LC_CTYPE", "Tibetan") [1] "Tibetan_China.950" > da

Error while running WTC (Wavelet Coherence) Codes in R

I am doing Wavelet Analysis in R using Biwavelet. However, I receive the error message: Error in check.datum(y) : The step size must be constant (see approx fun

How can I plot a sphere with plotly in R?

I would like to plot a sphere in the following plot: And that is the code for it: library(plotly) fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec,

Creating custom rendered footer values i a reactable

I am having a hard time to render my footer column in a reactable. I want to use JS here to access the client-side filtered state, and since iam not too familia

app$vspace error in building phylogenetic tree in R

I am working with phylogenetic trees. Import the phylogenetic tree file with ggtree::read.tree and get the information with readxl::read_xlsx. I want to visuali

How to create beepvar or dayvar from time-varying VAR

For my Thesis, I am applying time-varying vector autoregression (TVVAR) on time-series objects. I am using a dataset from an open-source paper. As R-package I a

R code error - Error arguments implying differing number of rows: 35, 13

I am creating an NMDS plot and first I need to create a dataframe with the scores from the individual sites. This is my NMDS code: nmds_results <- metaMDS(co