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

Image may be NSFW.
Clik here to view.

How to generate a grouped bar chart with 2 categorical variables

I would like to generate a bar chart similar to the one shown below. I would like to use rhoas x-axis and power as y-axis. And I have 2 categorical variables m and c. How can I generate a grouped bar...

View Article


How to demonstrate the power of dplyr's join verbs?

I've been wanting to demonstrate to a friend the elegance and speed of using dplyr's join verbs (e.g. inner_join()) over base R and simple subsetting. Took a big DB (from the nycflights13 package),...

View Article


Making a ternary plot

I want to plot the projection of 3-dimensional data on their simplex using ggplot2. I thought I could manage the transformation on cartesian coordinates using coord_trans(), but do not know how to do...

View Article

Table of classification accuracy in shiny

I'm trying to display a table in shiny that shows the accuracy of classifications for each group. Currently I can only manage to make it display the total count per group. Ideally, I'd like it to do...

View Article

How can I make a sentences that report values from each row in R?

Forgive me it's been a while. I'm writing a report and I want to generate sentences from this tree data "fill-in-the-blanks" style.Here's some data for example:species <- c("sugar maple","red...

View Article


How to get a dataframe using an Rsocrata API? [closed]

Using the Rsocrata package, I read data into a dataframe that shows the 2018 traffic accidents in and around Nashville, TN. I am trying to have my dataframe (traffic_df) return #of accidents,...

View Article

Officer package - Error in absolute_path(target)

Within my function, if I run each line manually I can save normally in docx through the office package. However, when rotating the function the following error appears:Error in absolute_path(target) :...

View Article

R increment by 1 for every change in value column and restart the counter

I would like to find a way to do very similar to this question. Increment by 1 for every change in columnBut i want to restart the counter when var1 = c using df$var2 <-...

View Article


r raster Can I combine two raster bricks directly?

I want to combine two (or more) raster bricks. Here's an example of what I want to dolibrary(raster) r <- raster(ncol=40, nrow=20) r[] <- rnorm(n=ncell(r)) b1 <- brick(x=c(r, r*2, r)) b2 <-...

View Article


Image may be NSFW.
Clik here to view.

How to turn the color scale in Plotly r to log scale

I am trying to have a logarithmic scale for the color bar in R, any ideas on how I can do it?My code: TEST_DATAFRAME = read.table(TEST_FILE, sep="\t",skip=2, header=T) PROD_DATAFRAME =...

View Article

Can formattable in R group a table by a variable?

Is it possible to produce a table using formattable which is grouped by one of the variables in the dataframe? The table could either be divided/split/grouped into separate tables printed consecutively...

View Article

Image may be NSFW.
Clik here to view.

How to fill geometric figures created by lines and curves?

I'm trying to fill with different colors the 3 triangles in the following graph. data = data.frame(x=c(125), y=c(220)) #this data is just to be able to use gplot to draw figures ggplot(data, aes(x = x,...

View Article

Image may be NSFW.
Clik here to view.

Double Integral implementation in R

I've working on double integrals using mosaicCalc package in R. I'm having trouble getting the correct result of the second double integral.This is the code of the first double integral which yields to...

View Article


Is it possible to write parquet files to local storage from h2o on hadoop?

I'm working with h2o (latest version 3.26.0.10) on a Hadoop cluster. I've read in a parquet file from HDFS and have performed some manipulation on it, built a model, etc. I've stored some important...

View Article

How to take an Average of + or - SD

I have data where the [1] dependent variable is taken from a controlled and independent variable [2] then independent variable. The mean and SD are taken from [1]. (a) and this is the result of SD:...

View Article


Image may be NSFW.
Clik here to view.

How to make high smooth, high resolution particle motion animations

For some time I have been having trouble with producing short movies/animations/gifs which are of sufficiently high resolution. I'm going to use R to generate some frames as a random example, but if...

View Article

dplyr sample_n by group with unique size argument per group

I am trying to draw a stratified sample from a data set for which a variable exists that indicates how large the sample size per group should be. library(dplyr) # example data df <- data.frame(id =...

View Article


Setting up a model using R2jags

I'm working on a project for an introductory Bayesian analysis course and I'm also fairly new to using R regularly. We are supposed to build a hierarchical model using a data set we found or put...

View Article

How to prevent Machine Learning Services (R) on SQL Server taking up high...

I have had Machine Learning Service installed on SQL Server to be able to run R scripts (called from Stored Procedures).There are now several of these Stored Procedures as part of a script to populate...

View Article

"Spread" na.locf data for irregular time data

I have data like the following:data <- tibble(time = c(ymd_hms("2019-11-01 09:33:00"), ymd_hms("2019-11-01 09:35:00"), ymd_hms("2019-11-01 09:40:00"), ymd_hms("2019-11-01 09:52:00")), data = c(1250,...

View Article
Browsing all 206180 articles
Browse latest View live


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