Is there any function to separete the marker click on shiny leflet
I have plotted some marker point according to my dataset[lag, lat,asset_id]. The objective is to, when clicking on the marker points, input$layput_marker_click should return the corresponding asset_id...
View ArticleDensity plot for multiple group shows one line, however legend shows 3
I am analyzing US election data volume from Google trend. I type the below command in R studio.The poliData dataframe contains the SearchVolume for all months for three Politicians.ggplot(data =...
View Article`README` badges not getting rendered properly in `pkgdown` website
I have thus far created 6 different pkgdown websites for my R packages (e.g., ggstatsplot, kittyR, etc.) and none of them ever had the following issue. For the first time, running the following command...
View ArticleReplicate ggplot2 chart with facets and arrow annotations in plotly
I want to replicate a ggplot2 chart in plotly, to that end I have tried to use the ggplotly function. The chart is the following (p_arrow):library(data.table) library(ggplot2) library(plotly) dset...
View Articlehow to use syntax in geom_polygon?
sorry for the question, I am still new in this. I found a nice code in the internet which shades areas between graphs with polygon (I cannot use geom_ribbon). I have to rewrite it into the ggplot...
View ArticleR nested for-loop only producing result with last column in dataframe
CONTEXT:I'm working with respondent-level survey data. Each row of my data frame represents an individual person's survey responses.My data frame consists of individual-level utility estimates from a...
View ArticleR data.table - best option for Cartesian join
I am looking for simple syntax for data.table's cartesian join e.g. I am using as below to get 1024 row in c_join but it requires to convert data.table to data.framed1 <- data.table(mtcars)d2 <-...
View ArticleShiny: updateSelectInput is blank after uploading data
I have a Shiny app that users upload a .txt file to and which users can then use to create a plot. The plot is conditional on the users selecting inputs based on the column names of their uploaded...
View ArticleCan you Recommend an R Tutorial on Parallelization RAM Management
I write in R. I'm using the future.apply package for CPU parallelization on a linux machine. My code is currently RAM limited (vs. CPU core limited). I load all necessary input data prior to...
View ArticleStandard deviation plot in R
I'm trying to create sd plot but really can't do this. What am I doing wrong? data_iris %>% mutate(st_dev = sd(Petal.Length)) %>% ggplot(., aes(x=Species, y=Petal.Length)) + geom_line() +...
View ArticleHow to calculate the average absolute difference between any two scores from...
I have a vector of n scores in an arbitrary order and want to calculate the average absolute difference between any two scores. Note, although I may not be using the correct term with "average absolute...
View ArticleMedian statistical difference in ggplot
I have a ggplot boxplot like this one:library(ggplot2) data(iris) ggplot(iris, aes(x = "", y = Sepal.Width)) + geom_boxplot() As you can see the median is 3. Say the real value is 3.8 what I would like...
View ArticleHow to solve ordinary differential equations with time dependent parameters...
I am trying to replicate an existing mathematical model in order to get "control" data for an independent research project. Link to article.I want to solve a system of five ordinary differential...
View ArticleShiny observeEvent in dynamically created secondary table
I've used an observeEvent to catch when a user clicks in a table row and get the row id in order to display a new tab with a drill down of the data for the selected category. I want to be able to do...
View ArticleHow to use function RNN in R for demand forecasting
I have been trying to construct a recurrent neural network in R for time series demand forecasting. Keras/tensorflow are just too confusing to use in R so I have tried the rnn package (trainr function)...
View ArticleFinding which elements in a vector have an edit distance of one and the same...
I have a dataframe, an example in .csv format is shown below, that has a list of words (Word), the number of sounds in those words (NumSounds), and the transcription of the sounds in each word...
View ArticlePattern fill in mapview?
Is it possible to fill polygons with patterns (ex. diagonal lines) instead of colour using mapview? My searching hasn't turned up anything. Here's an example that produces colour-filled...
View ArticleEfficiently plotting millions of data points in R
I'm trying to plot some million data points in R. I'm currently using ggplot2 (but I'm open to suggestions of alternate packages). The problem is that the graph takes too long to render (often upwards...
View ArticleNeed help in writing such a code in R without using any packages
Write a function that takes a number of inputs (p) and size of a subset (k) and outputs a matrix where each row is a vector of TRUE/FALSE values (k TRUE entries, p - k FALSE entries) and together the...
View ArticleR: Named lists and description lists
R has two classes not so commonly used: "Dlist" and "namedList".As regard the first, it is mentioned with respect to Sys.getenv(), which returns a result of class "Dlist" if its argument is missing,...
View Article