Category "r"

How to generate multivariate normal data in R?

I'm completing an assignment, in which I have to generate a sample X = (X1, X2) from a bivariate normal in which each marginal is N(0,1) and the correlation bet

using the uniroot function with dplyr pipes

I'm trying to utilize the uniroot function inside a piping scheme. I have root data by depth, and I fit a model for each crop-year set and put the fitted parame

using the uniroot function with dplyr pipes

I'm trying to utilize the uniroot function inside a piping scheme. I have root data by depth, and I fit a model for each crop-year set and put the fitted parame

Nested list to dataframe [using purrr + map]

I've looked at a lot of posts so I'm sorry if this is redundant, but was hoping to get some help flattening a nested list: test <- list() test <- c( li

Specify order after gather and spread

I want to keep the order of the output variables the same as the order they were created in the mutate statement. How do I accomplish this? It seems to be reor

Download A File Generated Within An R Shiny App

I am currently trying to generate a Shiny App that at the press of a button generates and downloads data for a user. I have a user defined function that pulls d

Arranging bars in multi-panel Lollipop chart using ggplot2

I am trying to plot a multi-panel Lollipop chart using ggplot2 using the following code #Data df =structure(list(Indices = c("Time", "Z11", "Z51", "Z61", "Z161"

How to do a "Select * from" query using odbc

I'm using the odbc package in R, and I have an SQL Server database with a table that has a Name column that is nvarchar(max) and a PublishStatus column that is

How to combine countpct and binomCI into the same summary statistic to be used in tableby function?

I'm using the tableby function from the arsenal package to create summary tables. For most of the statistics I need to generate, this package gives me exactly t

how can i insert a google sites into jupyter notebook with R

Is there any command to insert a sites.google into a notebook with IRkernel? I can find just the method to get the visible hyperlink with markdown cell: IRdispl

Impute missing data in multivariate time series

I have a problem where I have to predict the sales of 4000 products in 3 months for a certain store. Within the 4000 time series I have many null values and esp

Question about the Division operator in R not returning the correct value

I am trying to caculate the Bayes Theorem for Cancer and tried to plug in the correct values in my formula as such: cancer <- (1 * (1/100000)) / (1*(1/100

Unbalanced panel error in PMG Analysis in R

I am trying to run a Fama Macbeth analysis in R, where I am using the 'pmg' function with the following code: Fpmg1 <- pmg(ret ~ HML_OBS + SMB + Mktrf + HML,

How to get reticulate to access virtual environment

I have a pre-existing virtual environment set up for my python requirements, D:/SC/venv. I am trying to import data from a pickle into RStudio. I gather that in

How to fix C function R_nc4_get_vara_double returned error in ncdf4 parallel processing in R

I want to download nc data through OPENDAP from a remote storage. I use parallel backend with foreach - dopar loop as follows: # INPUTS inputs=commandArgs(trail

How to install TinyTex from .zip file? (install_windows_zip not working)

I'm trying to install Tinytex from .zip file, as I'm unable to install TinyTex in the standard way (install_tinytex) due to some restrictions from my IT departm

How to Extract Meta Title using R?

I want to use R to extract ALL META Tiles Here're the URL: https://www.imdb.com/title/tt8031422/ https://www.imdb.com/title/tt8962124/?ref_=nv_sr_srsg_0 https:/

Descriptive statistics for ranked choice data frame

I have been hustling with an issue that should be easy to figure out and need help. There are four ranked choice variables V1, V2, V3, V4 in my dataset dtst.

How I can separate the subtabs or (nested tabs) in R markdown and not showing them all side by side?

Hi as mentioned in the question, please, I want to know the code needed to separate the sub tabs in and not showing them all side by side . I tried several code

What is the purpose of using unclass() function? and why the error ""the column indexes must be at most 2 if postive,not 3,4,5,6,7,8,9,10" appears

What is the purpose of using unclass() function in r ? I can't get it right. Can you demisifiy it with this code below? unclass(tele%>%mutate(dec=ntile(rev