I am wondering about the "behind-the-scenes functionality of ggplot2 and cut_number. I have some pretty complex data that has many subsets of data with a relati
I am learning how to code in R and I have written a piece of code that calculate the Net Present Value (NPV) of various assets at different points in time, give
I cannot fathom how to derive strahler order in R. Here's an example in postgres and neo4j. An attempt in R There are three rules (from the GRASS 7.8 Manual): i
library(tidyverse) library(ggplot2) library(plotly) data(mpg) ggplotly( mpg %>% ggplot(aes(x=hwy)) + geom_histogram(), tooltip = ("all")) When you
Let's say I had a survey question that read: What did you eat? [ ] apple [ ] pear [x] banana [x] grapes Now, I have the endorsed options as comma-separated st
I'm trying to get 300 dpi images with ggsave, and am only getting the default 72 dpi. Here's an example of the code I'm using: library(tidyverse) x <- rnorm(
How to efficiently multiply columns of two different data frames with same number of rows but different number of columns. I have two data sets Volumes and pri
Is it possible calculated stock using R? The formula is stock+purchase-sold. In this case first stock (row1) is 0, rg first result stockB1= 12 - 3 = 9 the secon
I've got a data frame that contains names that are grouped, like so: df <- data.frame(group = rep(letters[1:2], each=2), name = LETTERS[1:4
I've created a logistic regression formula regarding mpg for various makes and models of cars. One variable "origin" was integer with : 1=American, 2=German, 3=
I am trying to sort people in my dataset into three body-size categories (Small, Medium, Large). Consider the toy example below: library(ggplot2) library(dplyr)
I have a list in which each element contains a data frame with n nrows. For example, dfA <- data.frame(A=c("a","a","a")) dfB <- data.frame(B=c("b","b")) d
Big Update I found an inefficient, but working solution for finding peaks and peak interval, although it doesn't work for multiple groups(in the code below I us
I'm trying to use the neuralnet package to train a model on this data set. However, I'm getting the following error which I can't understand: Error: the err
Im currently working for a Dutch football club and run into some problems with getting the length of relationship of certain fans. In the image below a short ov
I am having a problem rendering more than one trelliscopejs displays in an html file created with Rmarkdown. I'm using self_contained=TRUE in order to render di
I cannot find how to insert a line break in long titles inside nodes. For example: library(DiagrammeR) mermaid(" graph TB A[GE Solution]-->C{ } B[
In R, how can I produce a list of dates of all 2nd to last Wednesdays of the month in a specified date range? I've tried a few things but have gotten inconsiste
I'm maintaining R code in my company that is use by multiple colleagues. I decided to convert my code into a package to make it simpler to share, maintain and
I have a zip file containing data in a private Github repo. I am writing some R code, and I wish to download the data into R. When I run the following code I ge