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

Image may be NSFW.
Clik here to view.

How to add ANOVA one-way p-value to ggplot with ggsignif

I have the following data library(tidyverse) library(ggsignif) set.seed(1) a <- rnorm(n = 10, mean = 5, sd = 1) b <- rnorm(n = 10, mean = 5.8, sd = 1) data <- data.frame(label = c(rep("A",...

View Article


Image may be NSFW.
Clik here to view.

Equation of the estimated regression line

I am doing an assignment right now where I am given the dataset (seen below) and am asked to obtain the equation of the estimated regression line.I know the answer that I need to find is 118.91-0.905x...

View Article


R: How to write a function that replaces a function call in with another...

E.g. I want to transform the codemean(x) tofn(x) everytime I see mean in the code.replace_mean <- function(code) { substitute(code, list(mean = fn)) # doesn't work substitute(substitute(code),...

View Article

How do I change the size of calendar icon in airDatepicker from shinyWidget?

I use airDatepicker from shinyWidget on my dashboard:HereI have succesfully change the size of the input container as shown in the picture, but not the container of calendar icon (the box where...

View Article

I am trying to knit an R Markdown file to pdf, and Im get the following error...

Im getting an error message when I try to render an R Markdown file to pdf, I get the following error:/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS PC_final_proj.utf8.md --to...

View Article


Function to change names of variables in R

I have a data set that has a poor naming convention in it and I'm struggling to find a way to automate the name changing process. An example of the data is shown below:x1 <- rnorm(10) x2 <-...

View Article

Working code stopped working when reloading rStudio

I have several chunks of code that use pipes and many of them have stopped working when I reloaded rStudio that did not happen before. The following code was working before:library(dplyr) df <-...

View Article

Error in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm =...

My csv file osagecreekfinal has dates (Date) in (YYYY-MM-DD) and L.s.ha is a continuous variable. I have performed this same code on 14 other files but it will not work for this one. I am simply trying...

View Article


Counting/repeating with conditions R

From a question I asked before (Count with conditions in R dataframe), I have the following table: Week SKU Discount(%) Duration LastDiscount 1 111 5 2 0 2 111 5 2 0 3 111 0 0 0 4 111 10 2 0 5 111 11 2...

View Article


Get type of all variables

In R, I'd like to retrieve a list of global variables at the end of my script and iterate over them. Here is my code#declare a few sample variables a<-10 b<-"Hello world" c<-data.frame() #get...

View Article

Test for no change in Limma

I'm looking for a way to identify genes that are significantly stable across conditions. In other words, the opposite of standard DE analysis.Standard DE splits genes in two categories: significantly...

View Article

Apostrophes and optional argument (?) in grep vs agrep

When I run the below 4 lines of code I dont get the same result from all 4. Why is the last line not finding a match? grep("CPA's", c("CPA's")) agrep("CPA's", c("CPA's")) grep("CPA'?s?", c("CPA's"))...

View Article

Image may be NSFW.
Clik here to view.

Merge two lists into single list containing single character vectors R

Okay I'm stumped, I know there are answers about merging lists, and my attempt builds on those answers, but they don't return a single char vector. I have a function that merges lists but the values...

View Article


Trouble accessing help documentation for a package I created

I'm new to R so I hope this isn't incredibly obvious. I created a package that contains two functions. I provided documentation using roxygen2 for each of the functions, documented and built the...

View Article

Create new vectors with no element being in the same position as the original...

This question is an extension of a question I asked earlier.Suppose I have a vector V1 (with two or more elements):V1 <- 1:10 I want to sample one or several vectors that:(1). no element is in the...

View Article


Cluster observations based on multiple variables

I am looking for an r function to create clusters in my dataset based on two variables (hope "cluster" is the right name for what I want to do) . Every two observations with the same value for...

View Article

Image may be NSFW.
Clik here to view.

How to make an animated bar chart like this

Is it possible to use R---perhaps ggplot2 + gganimate---to make an animated bar chart graph like the following?

View Article


Image may be NSFW.
Clik here to view.

Range Bar Graph in R

The plot is just for visualization. The bars rather than starting at a common zero point, begin at min value for that particular bar and end at max value for particular bar. When I use ggplot...

View Article

pandoc document conversion failed with error 127

I'm not sure how to make a reproducible example of this, but I'm curious to hear if anyone else has encountered this problem. I have an R Markdown file hosted via shiny server on an EC2 instance...

View Article

How to show "Please wait" in self-hosted shiny app until packages are attached

In the applications hosted in the shinyapps.io we find a "please wait" message until the libraries are attached or server is ready. Do someone know how we can achieve the same with a self-hosted shiny...

View Article
Browsing all 201839 articles
Browse latest View live


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