Using mutate_at with prefix column names to compare values
I have a dataframe with old & new values. I need to update new values if something changed. I think I am really close, but I can't find the missing piece using tidyverse. With base R - using a for...
View ArticleAdd a shiny widget inside shiny dashboard header section
Is there a way to add a selectinput() inside shinydashboardPlus() header? I do not want the dropdown menu ability that is offered by shinydashboardPlus(). I want something like:#app.r library(shiny)...
View ArticleHow to import files in R package rehh for haplotype homozygosity analysis
I would like to try the R package rehh to perform haplotype homozygosity analyses on population genetic data.I have faily simple data files I would like to input into rehh but it's not working for me....
View ArticleCan I use Plotly's Custom Buttons to update `shared_yaxes` in a faceted plot?
I am using plotly and I have a figure with subplots. I'd like to include in it a button to toggle the property shared_yaxes. Is this possible?Here a reproducible example (in python). Consider the...
View ArticlePlumber API to accept images for API scoring
I am trying to write a plumber function to accept images and score on images and return the scored result. So there are two parts I am trying to figure out. Part 1: writing plumber function and this is...
View Articlechange the python code to R code (especially, numpy and seaborn ) [closed]
Hopefully, I would like to change the python code below to 'R code'.==============================================import numpy as np xd = np.float32(np.random.rand(2,100)) yd= np.dot([ 0.1, 0.2], xd) +...
View ArticleRenaming different columns in a list of tibbles using purrr
I'm trying to rename several columns in a list of tibbles based on regex.Let's take a look on the following example:library(tidyverse) df1 <- tibble( id_site = 1, country = rep(paste0("country",...
View ArticleIn regex, what's the difference between a lookbehind and \K? [duplicate]
This question already has an answer here:Positive lookbehind vs match reset (\K) regex feature 1 answerI just learned about \K in regex, and was wondering if somebody could explain how it's different...
View ArticleTOC summary in the header of each slide
There is the list of possible R-Markdown templates for beamer_presentation in R-Markdown.And most of them include a kind of a "Navigation bar" at the top (or left/right) of each slide, like that:While...
View ArticleHow to incorporate the sufix of an output$sufix name into an...
I am trying to get the sufix of an output$sufix name in R Shiny and incorporate it into the input$sufix_rows_selected function. The drilldown table is coming empty. Would someone have any idea of what...
View ArticleForce ggsave to vectorize point geoms in .wmf-files
Plots produced with R are not usable for publication if they cannot be exorted properly. I work on a Windows Machine and use MS Word 2016 for all writing purposes. So, I wish to export my plots as .wmf...
View ArticleWeb Scraping in R | Unable to extract information under a certain node using...
I'm trying to extract a bit of information under the node /html/head/script[16] from a website (here) but am unable to do so. nykaa <-...
View ArticleHow can I empose the ntree parameter into the train() function of caret package?
I am using the following function to do cross-validation with the random forest algorithm on my dataset. However, ntree raises an error, saying that it is not used in the function. Even though I have...
View ArticleR - how to repeat sequence 1 to 522
I have two files ones with 522 project id that I want to extract from the first file.the following code works for extracting but I don't want to repeat manually 522 times the data$projectID==datid[x, ]...
View ArticleHow to iteratively run a query on each column in a SQL table with R?
I have a table with multiple columns (colA, colB, colC) and I want to run a query against each of them and store the result so I can use them for comparison purposes later, for example this query to...
View Articlecreate multiple columns with each column as a sequence of numbers in R
Problem: I wanted to add three columns in my data frame with each column being a sequence of numbers. But I want each column to vary with the other column. So here's an example data frame:data <-...
View ArticleOutput of linear regression model [closed]
I did linear regression model and use summary of the model to display estimates and p.values. I want a global pvalue for categorical variable with more than 2 two values. I know drop1() of the model...
View ArticleHow to establish case/control status based on first and last observations in R
I have a longitudinal dataset in R with mood scores over a period which starts on Day 1 for all IDs. The end day ranges for every ID (between 26 and 35 days). Based on the mood scores, I would like to...
View ArticleBetter solution to check elements of one character vector with another...
Hello! My goal is to compare two character vectors - the main being synonyms and another mixnames. The string elements in mixnames do not match exactly to what is in synonyms therefore some string...
View ArticleHow can I make R maintain utf8 encodings?
I have utf8 encoded text that R seems to be representing as ascii. Here is the simplest case in the R console. Is there a way to force R to encode the characters in utf8?
View Article