Apply a function across all combinations of variables and store the plot in a...
I have some data (iris dataset) and I also have a plotting function called decisionplot. My question is how can I apply the decisionplot function (which outputs a ggplot plot) to all combinations of...
View ArticleIterating through multiple substrings in a .txt file in base R
I've been tasked with calculating the GC content of a FASTA file using base R (no packages). My problem is that I don't know how to pragmatically iterate through the sequence while storing the sequence...
View ArticleTestthat is showing wrong result
I tried to test a sample code below, by writing a test file "test_real_roots.R". Bu the result I am getting is wrong. Actually if you observe carefully all my tests should pass, but I am getting 1 fail...
View ArticleUsing shiny modules and shinydashboard: shiny.tag error
I'm trying to create and use shiny modules inside a shinydashboard app but I keep getting this error:Error in FUN(X[[i]], ...) : Expected an object with class 'shiny.tag'. Here is the app as condensed...
View ArticleUsing fill in ggplot to colour polygons and boxplots with different types of...
I'm trying to great a plot with a grouped boxplot over the top of a set of polygons, and would like to use the fill aesthetic to colour the polygons based on a continuous variable, and the boxplot...
View ArticleR Visuals not loading in Power BI Services
I am having a nightmare with my R visuals in PBI Services, the visual worked fine for the last 9 months and come yesterday they are no longer rendering in PBI Service. I have checked to see if the R...
View ArticleR shinyapps won't deploy: "Error in value[[jvseq[[jjj]]]] : subscript out of...
The app runs fine locally. It uses a series of sliders to form a reactive i.e. block_data <<- reactive({blocks %>% filter(pred_percentile >= input$pred_slider[1] & pred_percentile <=...
View ArticleSaving large leaflet map file as pdf (or another sharp format) [R]
I would like to ask if there is any convenient way how to save leaflet map as pdf when it is very large file. I am aware of saveWidget that allows to save as pdf, however when map is very large it tend...
View ArticleDifferent colour palettes for two different colour aesthetic mappings in ggplot2
My question is very similar to this and this and also this question. I have a scatterplot (using geom_point) coloured by a factor, using a particular colour palette. I'm using stat_smooth to draw...
View ArticleRcpp code throwing error when knitting in Rstudio
Im trying to run the following rmarkdown code:https://docs.google.com/document/d/164VZx3_cZ4tBa1Um39VH1cQ4zqRuCvpCTj-B50Vq2gk/edit?usp=sharingBut Im getting the following error when I knit the...
View Articlefilter variable based on prior date value in r
I have a data frame like below :df <- structure(list(id = c("555900339", "555900339", "555900339", "555900339", "555900339", "555900327", "555900327", "555900327", "555703505", "555703379",...
View ArticleUnnest range of years when there are dummy variables in R
I'm working on a dataset containing information about individuals' place of residence and occupation. Originally, it says that someone resides at an address from a year to a year, e.g. from 1920 to...
View ArticleError in clust as it is an unused argument
I try to run this example:library(bibliometrix) download.file("https://www.bibliometrix.org/datasets/joi.zip", destfile = temp<-tempfile()) M <- convert2df(readLines(unz(temp, "joi.txt")),...
View ArticleMapview/Leaflet: Background maps not visible in R 3.6.2/RStudio 1.2.5033
My employer has updated to R version 3.6.2 (2019-12-12) and RStudio version: 1.2.5033, resulting in background maps in mapview and leaflet not longer being displayed. I am aware that depending on the...
View Articler dataTable save as RDS rather than jso
I'm trying to follow this example from the dataTable github which (as I understand it) saves a user edited dataTable to the server. However, I would like it to save as an RDS instead of a JSON file.The...
View ArticleHow to create rows using a loop?
I have a dataset that looks like this :ColA; ColB; ColC; PAR; BKK; Y; BKK; SYD; Y; NYC; LAX; Y; LAX; SFO; Y; I want to duplicate the rows where ColC==Y and if colB of a row==colA of another row, then I...
View Articleconditional grouping based on group invariant column value
I have a data frame:temp = as.data.frame(matrix(c(1,2,2,-3,1,1,2,3,-2,0,2,1,-5,1,1,2,1,3,0,0,3,2,4,-1,1,3,2,2,0,1,3,2,4,3,0), ncol=5,byrow = TRUE)) colnames(temp) =...
View ArticleCreate likert plot with two groups in R
I have issues trying to create a likert plot with two groups. I realized a survey in two communities. I now want to compare these two communities. So far, I have loaded a sheet with 3 columns. One...
View Articleextracting word from named vector in r through a variable
I want to extract a specific word from a named vector having set of two words. freq= c(23,34,45,21) names(freq) = c("good boy", "bad boy","good car","car good") freq I want all those words starting...
View ArticleChange legend symbol "a" with geom_line and geom_point
I have the following data stored in a dataframe called "astatdf2":sampletype variable value 1 tissue_T1 Entropy 11.61460794 2 tissue_T2 Entropy 14.23313815 3 tissue_T1 Clonality 0.09642700 4 tissue_T2...
View Article