Can I change the width of bars in a circular barplot without then having gaps...
I have some survey data where I have the number of times a factor gets mentioned during interviews and then the percentage of how many each of these mentions are either positive, neutral or negative. I...
View ArticleGenerate counts within group and subgroup
I want to create a column that counts how many times in a row an incident occurs. Imagine flipping a coin 100 times and you count the number of heads ("H") and tales ("T") that occur in a row:outcome:...
View ArticlePlotting a step function with only horizontal lines
I use ggplot2 to plot a step function using geom_step(). What I need now is to get rid of the vertical lines. This should be a quite common problem in math at least...The docs do not mention such...
View ArticleChnaging ggplot colors and increasing the size of the text (inside the plot...
I am using the xgboostExplainer package and I make my plot using the showWaterfall function. I would like to make the output of the showWaterfall plot a little more custom. I first run the...
View ArticleAdding error bars to a ggplot with reshaped data
I am trying to add error bars to a geom_line() plot which has multiple y values.To manipulate the ggplot2 y values I had to reshape the data frame in to long format and so the data is structured as...
View ArticleShiny textInput to sting used in SQL
I have a textInput in a Shiny app for the user to write three character product codes separated by a comma. For example: F03, F04, F05.The output of the textInput is used in a function calling a sql...
View ArticleR - How to remove NAs when using ASSIGN with a FOR LOOP?
I have some code which imports a data frame (keywordsDF), and whilst using a FOR LOOP, it (by using the colnames), creates new variables depending on how many columns there are in it:keywordsDF =...
View ArticleHow can I combine two lists together and then save them as multiple dataframes
I have two lists each with 13 dataframes and 8 rows with different numbers of columns, I really would like to combine them together column wise (cbind style), and then save each dataframe as a separate...
View ArticleSide By Side Tables In Rmarkdown
I'm relatively new to Rmarkdown and would like to create a report with two tables side by side. There are numerous references on how to do this using kable, knitr and mini.pages, and a few references...
View ArticlePlotting on a geographical map the provenience of our patients
I am trying to put on a Italian geographical map a dot reporting the provenience ('provincia') of our patients. Ideally, the dot size should be proportional to the number of patients coming from that...
View ArticleRcpp segmentation fault creating armadillo matrix
I'm having a really hard time to debug this error. The situation is the following:I have a pretty small C++ library, all contained in a 'src' directory (and subfolders), that links to armadilloby using...
View ArticleHow to get rollingMean function in R package Openair to work?
I'm trying to get the 8 hour rolling mean for o3 using the rollingMean function using this code:mydata <- rollingMean(mydata, pollutant = "o3", hours = 8) breaks <- c(0, 34, 66, 100, 121, 141,...
View ArticleTransform a 3D array into a matrix in R
I'm trying to transform a 3D array into a matrix. I want the third dimension of the array to form the first row in the matrix, and this third dimension should be read by row (i.e., row 1, then row 2...
View ArticleHow to count number of occurrences in a specific column that meet a condition...
I want to count the number of times a 4 letter factor observations occurs in a given column in a dataframe. How do I do this?
View ArticleSelf-referential values in an R config file
Using the config package, I'd like elements to reference other elements, like how path_file_a references path_directory.config.yml file in the working directory:default: path_directory : "data-public"...
View Articler - Having trouble applying a function to a vector
Still pretty new to R, so I'm not sure what I'm doing`wrong. I'm trying to apply this function to a vector in order to calculate % residual based on a starting value: residual <- function(vec,...
View ArticleWhat is the best way to turn a data set with first column headers and the...
What is the best way to turn a data set with the first column being the headers and the data being in rows versus columns? How do I convert them to columns? I have transposed the data and then...
View ArticleDivide UI in rows shiny
I'm having a problem with my UI in shiny. I need the dashboardBody to be divided by two rows.The first row is divided by 2 columns. One with one plot and the other with 2 plots, each one in a row.The...
View Article%like% with multiple patterns in r
Is it possible to use multiple pattern with %like% in a nested ifelse? If not, what would be the alternative?fruits<-c("apple", "pineapple", "grape", "avocado","banana") color...
View ArticleReading data into R causes Excel save error: "Someone else is working in...
I have to read files that are being updated on a day-to-day basis and stored on a shared drive. If I have an R session open in which one of these files has been read, the file cannot be saved with new...
View Article