How to turn on basic filter using google sheets api and still see all values?
I managed to write an R function using google sheets api's 'setBasicFilter' that turns on the basic filter on the cell range specified by the user. However, when the user tries to 'Filter by values',...
View Articlefitting a polynomial with a known intercept
I am using lm(y~poly(x,2)) to fit a second-order polynomial to my data. But I just couldn't find a way to specify a known intercept value. How can I fit a polynomial model with a known intercept value...
View ArticleIn R, the default selection on my selectInput is removed once the Shiny App...
I have created a basic Shiny Application using RStudio. I am using selectInput to filter the charts on my dashboard. One of the charts I created works fine, and the default selection is kept when the...
View Articleconvert similarly named unequally length list elements to data frame R
I know theres so many list to dataframe questions but I cant find the solution to this easy problem. Lets say I have: library(tidyverse) library(janitor) df <- data.frame( group = c(rep("A",3),...
View ArticleSplit a row into columns with conditions in R
I've a dataframe as under +----+-------+---------+ | ID | VALUE | DATE | +----+-------+---------+ | 1 | 10 | 2019-08 | | 2 | 12 | 2018-05 | | 3 | 45 | 2019-03 | | 3 | 33 | 2018-03 | | 1 | 5 | 2018-08...
View ArticleIs a Mlogit error caused by a variable column that contains only 0's?
I'm analysing data using mlogit. For a certain data.frames logit1 and logit2, this works perfectly fine. However, if I create a certain subset data.frame logit3 and conduct mlogit in the exact same...
View ArticleImport csv files to google sheets from shiny apps.io download
I have built a shiny apps.io server that takes csv files from the shiny apps project folder and renders them as simple tables with a download handler for each. My department want to display /...
View ArticleHow to generate a variable that corresponds to multiple columns?
I have a data set for 10 patients that looks like this: df = data.frame(id=c(1:10), event1=sample(1:4, 10, replace=T), date1=Sys.Date() - sample(100:500, 10, replace=T), event2=sample(1:4, 10,...
View ArticlePrint Plot of String Equation in R
I am new to R and have this pretty simple question. I am importing an equation from a json file called run.json. The JSON looks something like this. "equations": { "spec": { "expression": "x*x*x+2*x",...
View ArticleAdding a column with an if else statement
I'm trying to cut numbers into categories to create a new column. Basically, trying to create a letter grade ("A", "B", "C", "D", "F") from scores. I have reproduced a similar data frame to the one...
View ArticleHow do I pre-determine mutually exclusive comparisons?
The human eye can see that no value x satisfies the condition x<1 & x>2 but how can I make R see that. I want to use this in a function which gets passed comparisons (say as strings) and not...
View ArticleConditionally sum a range of columns based on another column in R
I've looked through several other related questions but haven't really found something that meets my case. I have a column that dictates how many columns will be summed into a new column. If...
View ArticleIn R, how to sum certain rows of a data frame with certain logic?
Hi experienced R users, It's kind of a simple thing. I want to sum x by Group.1 depending on one controllable variable. I'd like to sum x by grouping the first two rows when I say something like:...
View ArticleError in library.dynam(lib, package, package.lib) : shared object...
When trying to install the keras environment in my R studio I get the following error : > devtools::install_github("rstudio/keras") Error in library.dynam(lib, package, package.lib) : shared object...
View ArticleConsider the consecutive value in the data
I have a data with 3 columns ID, Time and Type; I Need to add a column called "categroy" and the sample data with output is given below: > dput(DF1) structure(list(ID = c("104 - 2019-06-03", "104 -...
View Articlefor loop to stack rasters stored in different lists in R
I have a nested List with many elements and x number of rasters inside each element. The simplified structure of the list looks like this: ## create main List r <- raster(ncol=3, nrow=3) values(r)...
View ArticleWarning: Rtools is required
Every time when I install package this warning occurs :WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools...
View ArticleConcatenate previous and latter words to a word that match a condition in R
I need to concatenate the previous and the latter words of a condition meeting word. Specifically, those who match the condition of having a comma. vector <- c("Paulsen", "Kehr,", "Diego",...
View ArticleNeed to change my plane R code to sparkR code
I successfully developed plane R code for nls Model on my R dataframe(df). but I need to develop same logic operations on sparkR dataframe suppose my df is sparkR dataframe How could I change my r...
View ArticleCollapse factor levels based on matching characters
I have many factor vectors in a tibble. It's a survey, so the levels are letter codes. They survey tool incorporates order of letter chosen at the time of survey (from a clicker), which may or may not...
View Article