Web Crawling in R using Rcrawler
I am trying to get speeches that are specified in links with title on the page "https://www.federalreserve.gov/newsevents/speeches.htm".For example, the first title on the page is "Spontaneity and...
View ArticleUsing reactiveValues across multiple modules in R Shiny
I'm trying to use reactiveValues across multiple modules in an R shiny app.I have set up an example to illustrate my problem. It consists of a main application containing a reactiveValue which is a...
View ArticleSIR model in Rstudio shiny
I´m trying to build the basic SIR model in Rstudio shiny. The model takes 2 parameters (beta = infection rate/day, gamma = recovery date/day), 3 initial values (S = numbers of susceptibles, I =...
View ArticleR Shiny - Dynamically show/hide editable datatables
I want to create a tabsetPanel that displays a selection of dataframes based on a selectizeInput, while also allowing for permanent edits of the data. I use editable DataTables to render the dataframes...
View ArticleFinding interconnected neighbours in a 2d matrix
I have a similar matrix as below a| b | c | d | e 1|1| 0 | 0 | 1 | 0 2|0| 0 | 1 | 0 | 1 3|0| 1 | 0 | 0 | 0 4|0| 1 | 0 | 1 | 0 5|0| 1 | 0 | 0 | 0 6|1| 0 | 0 | 0 | 0 i want to get the neighbors for each...
View ArticleThe system cannot find the file specified in RStudio
I receive this error message almost every time that I type something in the current r script that I am working on.The error message continues to pop up until I press Control + S multiple times before...
View ArticleInsert a column with file name
Having this code it is possible to read multiple csv from a file pathsetwd("C:/Users/Nathalie/mycsvs") files <- list.files(path = "C:/Users/Nathalie/mycsvs",pattern = ".csv") temp <-...
View ArticleIs there an R command to find out if dataframe values are convertible into...
Is there a way in R to find out if a value is convertible to numeric or not? I usually do type.convert(as.is=T) to convert my columns into numeric and perform mathematical functions. But my current...
View ArticleHow to rewrite the regression coefficients to form an equation?R
test<-lm(spreadsheet[,1]~spreadsheet[,2]) test<-test[1][[1]] > test (Intercept) spreadsheet[, 2] 359.6182526432944 -2.475447990866698 how to write the coefficients of a regression in order to...
View ArticleHow to add sample size used in plotting geom_jitter
I want to add how many samples were added to a graph, next to my stat_cor (ggpubr) text.I'm using the following code to generate the graph:dataset = mtcars ggplot(dataset, aes(dataset$wt,...
View ArticleRandomly split dataset but keep condition ratio 50/50 in each new dataset
My dataset looks like this (subjectID actually is the 2d column and condition the third). Condition is 0 and 1 (this is not the whole dataframe). SubjectID Conditie V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13...
View ArticleBootstrapping by multiple groups in the tidyverse: rsample vs. broom
In this SO Question bootstrapping by several groups and subgroups seemed to be easy using the broom::bootstrap function specifying the by_group argument with TRUE.My desired output is a nested tibble...
View ArticleHow do you load multiple rasters in [r] using a for loop?
I am trying to load 144 rasters (.tif) using a loop that refers to lists, but running into errors. Note that my directory only has these 144 .tif files in it, and there are portions of each filename...
View ArticleInsert style tag from a variable with !important in an htmltools::div element
for the R code below, I am trying to add an !important tag after the background color, which comes from a variable, but it is not working:``htmltools::div( class = "bar", style = list( width =...
View Articlerowsums with multiple factor conditions
i'm trying to sum rows with different conditions, but i got stuck in this partthis is a similar example of my databasefl<-c("rose", "sunflower", "rose", "sunflower", "lily", "sunflower", "rose",...
View ArticleTop_n return both max and min value - R
is it possible for the top_n() command to return both max and min value at the same time?Using the example from the reference page https://dplyr.tidyverse.org/reference/top_n.htmlI tried the...
View ArticleGraphing function inside 'for loop' in Rmd rendering very different plots...
I have a folder of xx .csv timeseries that I want to graph and knit into a clean HTML document. I have a ggplot code that produces the plot that I want using a single timeseries.csv. However, when I...
View Articledivide columns using pattern in colnames
Assuming I have the following simplified table which has dynamic columns a_x (where x is an index e.g 0, 1, 2, 3, 4...) and b_x respectively. The number of a columns is always equal to the number of b...
View ArticleR: Problem to get selector in web scraping multiple pages
I am trying to get points for a web scraping in multiples pages, lamentably I am getting problems in selector (I used SelectorGadget but without success).I have success for only individual web...
View ArticleHow to convert a Markdown file into an R DataFrame
I have the following markdown file (md3.md) and I want to convert it into an R dataframe using an XML conversion as an intermediary step. It is possible then to use XML R package to convert the XML...
View Article