Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 204771 articles
Browse latest View live

Use apply() to ggplot() to create and save individual jpegs

I have seen different variations of this question, but none that are straight-forward in answering a problem I come across all of the time. I often have large datasets like the one described in this...

View Article


Does GMM with first-order differencing require stationarity of endogenous...

I'm trying to estimate a panel VAR model with first-order differenced GMM estimator in R, using the {panelvar} package.I know that GMM requires the dependent variable to be stationary. But Does it...

View Article


How do I write my function calling data and column?

I want my function to:change the values in a column so that the ',' is a '.'convert that column to a doubleI have tried many different forms of this equation but I keep getting the error "Unknown or...

View Article

Differenced time series model

I want to run an Error Correction Model of this type for a time series :∆(ln⁡(Y_t ) )= ∝ + γ_1 ∆(ln⁡(〖PIB〗_t ) )+∅1 ε(t-1)+μ_1The goal is to get a regression with differenced variables and containing...

View Article

Dynamically create selectInput ids based on vector length

I'm creating a Shiny app which requires certain divs to have the same dropdown menus, but I need to give each of the divs a unique id so I can access their input$id. I've created a function to create...

View Article


Multidimensional array operation with R Inline and fortran

I want to integrate Fortran code into my R Package. In order to practice, I am trying to use ´inline´ with Fortran code. I can create the cfunction, however, When I try to run it, I get...

View Article

UpsetR: manually order set intersections to align multiple upset plots

I am making multiple upset plots using the UpsetR package and will combine them using grid.arrange to make a single figure. Is it possible to coerce the order of the intersections so that they are...

View Article

Errors making predictions on MCA object FactoMineR

I'm trying to get new coordinates from an MCA analysis in R, using MCA from the FactoMineR package. Where df is a dataframe,res = MCA(df) predict.MCA(res, df) Produces an error : Error in...

View Article


The function in R that can calculate how many times a digit appears in a vector

So, for example, if I have a vector x <- c(11, 2354, 55, 432, 1112, 320), the function should return a vector that indicates how many times the digits 0, 1, 2, ..., 9 have appeared in x. For 'x',...

View Article


"Hmisc" package or namespace failed to load - no package called 'latticeExtra'

I'm having trouble loading and running the Hmisc package. When installing it, I get the following error; library(Hmisc) Loading required package: lattice Loading required package: survival Loading...

View Article

Formatting a data.frame with binary values

I have a dataframe with 4 columns and 4 rows. For simplicity, I changed it to numeric format. The schema is as follows:df <- structure(list(a = c(1,2,2,0), b = c(2,1,2,2), c = c(2,0,1,0), d =...

View Article

How to conditionally format table column background colors based on column...

I am working with some data where I need columns of a table to have background colors based on a comparison of the name of the column to a value in another table. The first table has columns '1'...

View Article

Using R to answer [closed]

R-Studio (R Programming Language)How would you create a vector V containing the values 0, 0.25, 0.5, 0.75, and 1?#insert your code Name the elements of V: first, second, middle, fourth, last. Describe...

View Article


How can the facet function in ggplot be used to create a histogram in order...

This is an example of the variables that I would like to visualizeid post.test.score pre.test.score messages forum.posts av.assignment.score 1 0.37 0.48 68 7 0.19 2 0.52 0.37 83 22 0.28 3 0.42 0.37 81...

View Article

Volcano plot for multiple clusters

I am trying to make a volcano plot for different clusters. I have 2 conditions, untreated vs. treated. I have a differential expression excel file that cellranger generated for me but within the file...

View Article


Is there any way to plot three numerical variables and one categorical in...

enter image description hereI tried to create a scatter plot with three numerical variables, which are Longitude, Latitude and penetration rate. From the color in scatter plot I can have an idea about...

View Article

If then command yielding string as output in r

I am trying to calculate after-tax income for each household in a data frame like this: id hhinc 1 1 53880 2 2 49501 3 3 37525 4 4 28791 5 5 91049 6 6 133000 7 7 12299 8 8 23000 9 9 58100 10 10 9764...

View Article


Image may be NSFW.
Clik here to view.

Putting widgets in multiple columns in shiny

I have an excel workbook with multiple tabs, in this case 3, which looks like this: ,,.My code is this:library(shiny) library(readxl) library(tidyverse) ui <- fluidPage( fileInput("config","Load...

View Article

How to knit a project while there is an error message for a missing library

I encountered issue to knit a project due to an error message like below: Error in check_for_XQuartz() : X11 library is missing: install XQuartz from xquartz.macosforge.org Calls: <Anonymous> ......

View Article

Problems installing the devtools package

I wish to use the devtools package. I've run the following commands:> install.packages("devtools", dependencies = TRUE) .... > library(devtools) Error in library(devtools) : there is no package...

View Article
Browsing all 204771 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>