Replacement functions in R that don't take input
This seems very related to several other questions that have been asked (this one for example), but I can't quite figure out how to do exactly what I want. Maybe replacement functions are the wrong...
View ArticleBubble chart with R
I have a table with an abundance of species in different months. I want to make a bubble chart wherein the y-axis for abundance species and x-axis for the month while the radius of the bubbles for the...
View ArticleFind matrix satisfying conditions
I'm looking to solve the following problem in matlab, but don't know which command to use.Find a matrix B, s.t. A * B = I and 0 <= B*a <= bWhere A and B are matrices and a and b are vectors. I is...
View ArticleShared variability between fixed and random effects
I need to determine shared variability between fixed and random effects in a mixed model in R:MODEL <- lmer(LNC ~ Soil.VAR + (1 | ZONE)r.squaredGLMM(MOD) # calculates the marginal R2 + conditional...
View ArticleAdd different suffix to column names on multiple data frames in R
I'm trying to add different suffixes to my data frames so that I can distinguish them after I've merge them. I have my data frames in a list and created a vector for the suffixes but so far I have not...
View ArticleFunction to add singleton (near tip) in one step
Is there any function to do that in one step? I am applying a two-step workaround { require(grid) require(phytools) require(ggtree) set.seed(10) tree <- rtree(7) myggtreeplot <- ggtree(tree) +...
View ArticleGoogle authentication to access Bigquery from R
I am trying to use the bigrquery package to run query in Google's Bigquery with below code -library(bigrquery) bg_auth("My_Email", "My_Token") Now, once I hit above line of code, R tries to open a...
View ArticleHow do I get the coefficients of my fmean equation when using sGARCH in R...
I hope someone can help me with the following basic question regarding GARCH in R:Trying to find out whether there is a day-of-the-week effect in some indices I have done the following OLS in R:𝑅𝑅𝑡𝑡 =...
View ArticleIs it possible in R to test for the existence of specified...
I am working on a ggplot2 extension package for my organization to use, to apply our design guidelines to all of our R charts. Part of this requires the use of specific fonts. We use the Whitney...
View Articlemapply giving non-numeric argument to binary operator error in R
I am trying to generate a variable flagging implausible age differences between respondents and their parents in a household roster. I have two issues i) my function does not replace the flag variable...
View Articleforeach slows down dramatically
I'm running a number of serial, non-threaded processes using foreach. The intent is to run 300, but after the first 30 or so, these processes begin to crawl to a halt. The processes happen to be lasso...
View Articlebarwidth in histograms is not the same
My data looks like this. If I plot a histogram of pH.Value for a specific Uniprot.Recommended.Name on a grid based on Space.Group with code like thislibrary(tidyverse) ggplot(data = filter(massaged,...
View ArticleCheck previous row in datetime, if time is greater than a certain value,...
I have a dataset, df: (the dataset contains over 4000 rows) DATEB 9/9/2019 7:51:58 PM 9/9/2019 7:51:59 PM 9/9/2019 7:51:59 PM 9/9/2019 7:52:00 PM 9/9/2019 7:52:01 PM 9/9/2019 7:52:01 PM 9/9/2019...
View ArticleHow to extract quarters from dates?
Why doesn't the cut at "3 months" produce labels as expected? # create time series data everyday <- seq(from = as.Date('2014-1-1'), to = as.Date('2014-12-31'), by = 'day') # create a factor based on...
View ArticleUsing purrrs "pluck" to select list items and plot
I am trying to extract some data from a list from a trained Neural Network using keras. I have 4 lists I want to put into a single data frame.I want to map over the lists and pluck the metrics item...
View ArticleKeep values in data frame= Na (sodium in chemistry) as is
Original df (clinical chemistry)Subject Code Test Value Units Flag 1 NA NA 147 mmol/L 2 NA/K NA/K 10.5 RATIO 3 K K 4.7 mmol/L 4 CK CK 235 UL ... Ideal df after cleaningSubject Code Test Value Units...
View Articleselect text from multiple combinations of text within a dataframe R
I want to subset data based on a text code that is used in numerous combinations throughout one column of a df. I checked first all the variations by creating a table. list <-...
View ArticleSparklyr k8s gClouid - Pods aren't running
everybody As the title says, I would be curious to understand why I can't connect via Sparklyr to gCloud clusters using kubernetes.The steps to configure the system were as follows:project creation on...
View ArticleHow to address missing value error in mgcv
When I try to run a model in mgcv I get the following error:Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { : missing value where TRUE/FALSE needed My syntax is based on the 2019 paper 'Analyzing...
View ArticleHow to pull out pairs of data from a list inside a dataframe (with tidyverse)
I have a json output (from topydo) which has (after some manipulation) a column called tags where the tags (if they are present) are pairs of data in a list. Usually they will be a due date "due",...
View Article