Formatting Shiny Plotly subplots - Individual titles and graph size
I'm trying to provide individual titles for each of my graphs within plotly's subplot function and I found a post where you can extend subplot using %>% layout(title = "Main Title) but I'd like...
View ArticleSub-sampling by ID and Day
I have a large data set that I want to sub-sample. My goal is to have one measurement (X) for each individual (ID) per day (datetime).My original df looks like this:> df ID X datetime 555 287...
View ArticleHow to Switch Between NavBar Tabs with a Button R Shiny
I need the user to click a button and be taken to a different tabPanel of a navbarPage. Here is a simple app where this could be implemented. How can I achieve this?ui <- shinyUI( navbarPage('Test...
View ArticleHow to extract numeric part with "e" from a string
I have a string like "reflectance_scales=5.011129178e-05". I want to extract the part "5.011129178e-05" in numeric form.I have tried:gsub("[^0-9.]", "", "reflectance_scales=5.011129178e-05") but it...
View ArticleHow to use long data for boxplot in R
I am trying to create 3 boxplots for Depression scores for 3 groups, organised as long data in my table as below: Ppt_num Depression_score Group Age Gender <dbl> <dbl> <dbl>...
View ArticlePassing environmental variables to shinyapps.io
I'm trying to publish a Shiny app to shinyapps.io but the app requires a Quandl API connection. I don't want to put the API key in my code so I use a .Renviron file to store the API key. This is the...
View ArticleLeaflet plotting not only Countries but also regions of each country
So I am learning leaflet library for maps and I would like to ask how to plot not only countries but also regions for each country all well,Regions can be clearly seen but is there a way hot to plot...
View ArticleWhy I don't see any calibration progress even when setting verboseIter = TRUE?
I'm using caret and my own model as described here 13 Using Your Own Model. I have tested it with small tuning grids and it works. However, even when setting the verboseIter = TRUE I see no progress...
View ArticleHow to correlation cluster in R?
I have pairwise gene - gene correlations in gene essentiality. So essentially a sample looks like this:where var1 and var2 are the genes and the value is how strongly negatively or positively...
View ArticleHow to use Memoise in R
I have been trying to use memoise to speed up computations for a function I wrote. In a nutshell, I have a function a() that performs do.call() on another function b(). function b() runs code to read...
View ArticleLoad a xgboost model in python which was saved by `xgboost::save()` in R
I have a xgboost .model file which was generated using xgboost::save() in R. Now, I want to load this and use it in python.
View ArticleHow to pivot data in R?
I have a data set as I've shown below:df <- tribble( ~id, ~clicks, "1", 10, "2", 5, "3", 7, "4", 6, "5", 3, "6", 4, "7", 5, "8", 6, "9", 1, "10", 9, ) Now, I want to set an interval from id column...
View Articleshinyapps.io Timing Out When Scraping Data
I have a shiny app that works fine locally, but times out after 60 seconds when I publish it to shinyapps.io. The code that I believe it is tripping up on is a function from the nbastatR package called...
View ArticleDetermine if all IDs in the column of one data.frame are in a column of a...
I have two data.frame tables in R. Both have IDs for users who took particular actions. The users in the second table should all have done the actions in the first table, but I want to confirm. What...
View ArticlePush error message to the R Shiny app interface
Does anyone know how to push the specific error message to the R Shiny interface?When I run my app in R console, when there is an error, the app will show the specific reason for the error. However,...
View ArticleCan timing or memory usage illustrate the hazard of growing objects in a loop?
Occasionally, we find novice R programmers build data frames in a for loop, usually by initializing an empty data frame and then iteratively calling rbind. To respond to this inefficient approach, we...
View ArticlePlotly custom modebar icon change color and shape, and open link in a new...
I am using a custom modebar icon to open a link in a new window, and have some related problemsProblem 1)Custom icon is not a square. If rescaled to fit in a square would be too small. How do you get...
View ArticleQuantile regression error with dummy variables in ggplot
So I am trying to calculate quantile regression and plot result in ggplot for some reason dummy variables cannot be shown for some reason when plotting result in ggplotCode on example mtcars dataset if...
View ArticleR Limma P-Value vs Foldchange on cytokine data
I am trying to work with limma from Bioconductor to calculate the p-values and foldchange values and find differentially expressed genes.My data looks like this. 1. CYTO Value ABC1 2.3 ABC2 2.3 ABC3...
View ArticleHow do I use predict() to find the slope of the line tangent to my drm LL.4...
First - thanks to all who contributed to writing the drc package in R!I have a four parameter logistic LL.4 model that fits my data well. I've figured out how to use predict(model1,...
View Article