Category "r"

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

problem with classes when scraping tripadvisor with rvest

I am trying to scrape tripadvisor reviews. I use the code trip_ad <- read_html("http://www.tripadvisor.com/Hotel_Review-g189400-d10798588-Reviews-Electra_Met

Plot Layout of Base R Plots Saved by recordPlot() Function

I can use the recordPlot() function to save Base R plots in data objects: plot(1:5, 1:5) my_plot1 <- recordPlot() plot(1:10, 1:10) my_plot2 <- recordPlot

Adding a column, of which the values depend on whether the value in another column, matches one of four vectors

I have data as follows: library(stringi) datfake <- as.data.frame(runif(100, 0, 3000)) names(datfake)[1] <- "Inc" datfake$type <- sample(LETTERS, 100,

Difference in R and SPSS LMM output

I am working on a linear mixed model and am attempting to run one on the same data in r and spss. I'm using a treatment with two levels, looking at 10 different

RMarkdown slidy presentation: tabset?

I am looking for a way to use {.tabset} in an RMarkdown Slidy presentation, but the tabs are not created and it just lists everything sequentially on the slide.

Error in as.vector(data) : no method for coercing this S4 class to a vector in R

I am trying to run volatility from GARCH model: Used libraries: source("TimeSeriesFunctions.R") library(PerformanceAnalytics) library(fGarch) library(MonteCa

ggplot2 geom_point position= "dodges" doesn't match the error bar dodge

Im trying to figure out the best way to plot changes in water potential through summer comparing two factors, soil cover treatments and irrigation. I reached a

Highcharts bubble map does not always render properly

I have created a shiny app, which displays a highchart Map. With a select input, one can choose specific countries that one wants to be displayed. Most of the t

R find all possible unique combinations

I am trying to find all possible unique combinations in R. It seems that there have been a lot of similar questions asked, but I was not able to find the same o

error: 'predictions' contains NA while predict landuse change using glm model (lulcc package) in R

I made a prediction model for land use change using the lulcc package in R. Prediction was done using glm. When I did the glm.pred (the last line), there was an