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

How to use a column for a shaded area in ggplot,R?

I have a dataframe of 2 columns, my values and the standard error. What I want is to plot a line with my values and then add the standard error as a shaded area around my line. I do not even know how...

View Article


Using mRMRe for feature selection : my categorical target variable is...

I have a data frame "data" with 60 rows (=samples) and 20228 columns where the first column is my target variable (an ordered factor : 0 or 1) and the other columns are my features (=numeric). I want...

View Article


ntile function producing only one group

I have a data frame containing numeric variable with no NAs.I have previously used ntile to split this variable into 10 groups which using in conjuction with mutate gives me a new variable with...

View Article

Trying to plot multiple facets of boxplots and label outliers

I have data frame structured like this:>data ID Element Location FirstPt LastPt First3 First5 First7 First10 Last3 Last5 Last7 Last10 12 Copper Alpha … … … … … … … … … … 12 Iron Alpha … … … … … … …...

View Article

Subset a dataframe with dynamic dates by date range in R

I have the dataframe below:dates <- data.frame(rep( seq(as.Date('2017-01-01'), as.Date('2017-12-31'), by = 'days'), times = 1)) colnames(dates)<-"day"And I would like to subset it by the last 2...

View Article


Pattern to capture words certain words in any order

I have the following strings :combine (valid)combine, online, store (valid)store online (valid)online (valid)combine, anything else (invalid)anything else combine (invalid) combine-online (invalid)I...

View Article

ReadMe link to OS that package binary does not exist for (CRAN)

I have a package that will not build on Mac as a binary but can still built if done with source. The intended audience for this package is likely not familiar with command line and I want to make it as...

View Article

R read.csv loop with iterating variable in quotation marks

This is my code:library(data.table) library(stringr) parameters <- c("conductivity","calcium","chloride","magnesium","phosphate","potassium","salinity","sodium","sulphate") for (i in parameters){ i...

View Article


Image may be NSFW.
Clik here to view.

R Package binaries for windows not available on R < 3.5, only being compiled...

First, I know that on windows you can compile packages from source using Rtools. We are trying to avoid having to compile the packages locally. Are the Windows binaries not being compiled for older...

View Article


Convert R yacas equation to LaTeX without solving it

I want to show step-by-step calculations that were made using 'TeXForm' in Ryacas. To do that I must be able to obtain LaTeX from given equation. Issue is that yacas automatically solves them before...

View Article

Is there an R function to order a matrix using two or more columns?

I simulated a data of 3 columns aa <- rep(seq(0,1,0.05), seq(21,1,-1)) bb <- NA for(i in length(seq(0,1,0.05)):1){ bb <- c(bb,rep(seq(0,1,0.05),len = i)) } bb <- bb[-1] cc <- 1-(aa+bb)...

View Article

How to save all console output to file in R?

I want to redirect all console text to a file. Here is what I tried:> sink("test.log", type=c("output", "message")) > a <- "a"> a > How come I do not see this in log Error: unexpected...

View Article

How to get a regression summary in Python scikit like R does?

As an R user, I wanted to also get up to speed on scikit. Creating a linear regression model(s) is fine, but can't seem to find a reasonable way to get a standard summary of regression output.Code...

View Article


Image may be NSFW.
Clik here to view.

Vertically align column name using kable and rendering with rmarkdown into html

Created the table below and would like to vertically align the word "Species" in the center/middle of the cell. I am using RMarkdown to generate the HTML not LateX. Any tips? --- title: "Untitled"...

View Article

Converting Text to Number and Then Multiplying Fails in R

I have three data frames each with one column and same length with the following example data:df1 = (1, 2, 3) df2 = (a, b, a) df3 = (2, 3, 4) I convert all "a" values in df2 to 100 and all "b" values...

View Article


Proxypass isn't keeping the desired URL

I'm using www.shinyproxy.io solution to scale a R shiny app. I have some web apps under www.mydomain.com/shiny and, for example, I can access the /register app by writing...

View Article

Creating multiple plots in ggplot from a dataf rame with titles corresponding...

I am trying to create multiple scatter plot graphs in ggplot that have the same structure but I want to have the respective name of the rows in the column. I need them to be separate (and therefore not...

View Article


Random effect with gam() with betar family in R

I'm having trouble with my gam() analysis with betar family and the weird thing is that it worked perfectly before. After I restarted R, all kinds of error and warning messages showed up.I'm analysing...

View Article

Sum values lower then a threshold with constant

For instance I have a vector:x <- c(6, 22, 18, 5, 19, 14, 17, 88,30, 0, -1, 2, 3) How do I check for values lesser than 17 and change the values to value + some const?something like this: x[x <...

View Article

How to code a predictor in logistic regression when some values are...

I decides to post my question here because, strictly speaking, it has to do with coding.The problem is as follows. In a psychological experiment involving two conditions, an independent variable - made...

View Article
Browsing all 201839 articles
Browse latest View live