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

Have different .RMD file and output file names

I'm having troubles name my output PDF file from my "Knit with Parameters" RMD file. my YAML header looks something like this:--- title: "Discounting" output: pdf_document #with more parameters for...

View Article


How to select a nested field with bigrquery using dplyr syntax?

I'd like to explore a Google Analytics 360 data set with bigrquery using dplyr syntax (rather than SQL), if possible. The gist is that I want to understand user journeys—that is, I want to understand...

View Article


Recursion that splits a object with numbers in several data frame rows

I want to write a function that splits a vector with several numbers in a way which if I have the line:secs = c(1, 5, 8, 19, 25, 91) It'll answer me a data frame with two rows, called st and end in...

View Article

How To Edit Common Legend Title In ggarrange?

How do I edit a common legend title (make it bold font and enlarge the font size) using ggarrange?Based on the six plots I have (p1 to p6), I thought the following would work:p6 <- p6 +...

View Article

mRMR classic in R

Is there any way to include categorical values in the evaluation of mRMR.classic for feature selection in R? Whenever I try with class types other than ordered and double it gave me the following...

View Article


Correctly geocoding lat and long in R

I am trying to geocode a dataset using the given latitude and longitude. I am then going to use these points and join polygon features to them. However, the projection I am using for the points is...

View Article

Image may be NSFW.
Clik here to view.

R Studio not installing

I am attempting to install R studio but I am getting this error:I uninstalled it and then reinstalled it multiple times but I still get this error, can anyone help?

View Article

How to find equal lines in different tables in R?

I am working in R using two different tables with three columns, e.g.:Initial Final Changes 1 1 200 1 3 500 3 1 250 3 3 175 Table 2 Initial Final Changes 1 3 180 1 5 265 3 3 147 3 7 155 I need to sum...

View Article


Image may be NSFW.
Clik here to view.

Add text to legend color square in ggplot2

I'm making a diverging bar plot for some Likert data (along these lines). The client has requested a "mean response" for each group, treating Likert responses as consecutive integers ("Strongly...

View Article


re-hide conditional shiny output once it has been rendered

I need some help as to how to re-hide a shiny output once it has been rendered. Below I have provided a reproducible example to explain my question. I want text 2.2 to only be shown if Option 1 and B...

View Article

R: How can I use R's formula notation to compactly produce all but a selected...

I'd like a way to compactly use R's formula notation -- or some other formalism --to include all the quadratic terms between a set of variables A through E, excluding the D:E interaction. (My real...

View Article

paste0 in ifelse R

I try to use paste0 in an ifelse() to create a conditioned new variable in a data table. The code I use is the following:data[, paste0("inc_2014_",i) := ifelse(paste0("testvar",i) == 2014, 1, 0)] This...

View Article

Revaluing many observations with a for loop in R

I have a data set where I am looking at longitudinal data for countries.> head(master.set) Country Country.ID Year Happiness.Score GDP.PPP GINI Status 1 Afghanistan Afghanistan 2015 3.575 1766.593...

View Article


R: remove rows from one data frame that are in another

I have two data frames df1 and df2. They have the same (two) columns. I want to remove the rows from df1 that are in df2.

View Article

Image may be NSFW.
Clik here to view.

drawing circle in R

I don't know why the following code doesn't give me the complete circle and gives only parts of it. Also I don't know how I can show my points on the circle or outside of it within a square both...

View Article


How do I generate 5000 synthetic data sets in R with 1000 observations in...

for each I need to For each data set, set σ 2 = 10 and µj = j, where j = 1, . . . , 5, 000 is the index of a data set.

View Article

Image may be NSFW.
Clik here to view.

Coding asymptotic results for balanced experiment designs question:

I'm trying to code out some equations in a paper to help test some sample data, but having trouble interpreting the statistical equations and converting them to code in R. I'm trying to define H and G...

View Article


mirrored barplot on with two different scales

i would like to plot a stacked mirrored barplot. For this i need to apply to different scales. I show you the table:a b c DS1 1 0.082 DS1 2 0.045 DS2 1 0.038 DS2 2 0.013 DS3 1 0.022 DS3 2 0.017 DS4 1...

View Article

Renaming Variables Dynamically

I have a file named 'schema'. Based on the file, I need to rename other data frames. For example, 'Var1' of TableA needs to be renamed to 'Col1'. Similarly, VarA of TableA needs to be renamed to ColA....

View Article

Conceptual question: how can we extract specific values that fall under...

I am trying to understand how to derive a percentage of values that specifically fall within multiple categories from more than two tables. For example, given a sample scenario where only a small...

View Article
Browsing all 206180 articles
Browse latest View live


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