How to add color in emmeans graph?
I would like to have one color for each level in x axis. I have tried different ways to enter the colour via col argument, but it doesn't seem to work. So far:df <- structure(list(Scanner =...
View Articlemy shiny app does not load images after deploy on shinyapps.io but it works...
I had put all my images in "www" folder while deploying the app. But even though it is unable to load the image https://tejasviohlan.shinyapps.io/student/ while it works fine locally you can look...
View ArticleSpreadsheet-like calculation in R with a growth component
I have a spreadsheet calculation that I want to transfer into R. I have a few columns and rows that I am trying to do some simple arithmetic on, and a couple of ifelse.See imageThe short question...
View ArticleCan geom_smooth accept logical variables for glm?
I have a tibble with numerical and logical variables, e.g. like this: x f y <dbl> <int> <dbl> 1 -2 1 -0.801 2 -1.96 0 -2.27 3 -1.92 0 -1.75 4 -1.88 0 -2.44 5 -1.84 1 -0.123 ... For...
View ArticleCompare two strings and look for differences and display them for easy...
Suppose I have to rather long (>100k character) strings which are mostly identical but differ in some locations. Git has the concept of a 'diff', which shows only the differences between two (text)...
View ArticleHow would I recursively add values in a tibble using purr in the tidyverse
I'm new to R and the tidyverse and I'm trying to understand how purrr could be used to add recursively.I have a tibble comprised of 8 rows and 4 columns. The data in the tibble represents runners at...
View ArticleHow to show code but hide output in RMarkdown?
I want my html file to show the code, but not the output of this chunk:```{r echo=True, include=FALSE} fun <- function(b) { for(a in b) {print(a) return(a * a)} } y <- fun(b) ``` When I run the...
View ArticleCreate a new Rcpp::DateVector using given dates as string
How can I create a new DateVector (a C++ class from the package Rcpp) with dates given during compile time?Since a DateVector is an NumericVector I can do this:DateVector d = DateVector::create(14974,...
View ArticleHow to split number series in equal size chunks and save in a list in r
I'm new to R. I am trying to separate a series of number into equal-sized chunks, for example, X <- 123456798123 it has 12 characters in it. Now I want to divide/split them into 6 character size...
View ArticleexcelTable from excelR package R programming is not showing out put
excelTable() from ExcelR package is showing no output in the Viewer Pane. I have updated all the dependent packages. what could be the problem?data = data.frame(Model = c('Mazda', 'Pegeout', 'Honda...
View Articlecomparing two numerical variables in R
I have run the R function stl() function and use its generated residuals for grubbs test. The code is the following:stl.res = stl(dataset, s.windows='periodic') residuals =...
View ArticleHandling java.lang.OutOfMemoryError when writing to Excel from R
The xlsx package can be used to read and write Excel spreadsheets from R. Unfortunately, even for moderately large spreadsheets, java.lang.OutOfMemoryError can occur. In particular,Error in...
View ArticleR %in% operator for RefClass objects
I've the following problem. I know how to do a workaround for this but its more of a esthetic thing:A <- setRefClass("A", fields = list(a = "character")) A$methods( equal = function(obj){ a == obj$a...
View Articleadd saga gis to PATH and execute it from command line
I know this is a way too easy question. That's probably why I didn't find anything useful on stackoverflow. So I downloaded SAGA and just want to run in from my command line. I thaught well, that can't...
View ArticleSetting active docker machine in R
I wanted to do some webscrapping in more professional way. To do this I wanted to start a docker machine and run selenium server on it from R.My code:shell("docker-machine create m1") # Creating docker...
View ArticleIs there a function in Base R that convert fractions to doubles [duplicate]
This question already has an answer here:Convert a character vector of mixed numbers, fractions, and integers to numeric 2 answersI have a dataframe that includes both pure fractions, integers with...
View ArticleMultiple time series in a long format tsibble
I want to run time series models to forecast one step ahead using fable package. As far I understand, I need to have my data in tsibble format. Here is what I am trying to do,Generate three idsTime...
View ArticleSelect rows with common ids in grouped data frame
I am searching for a simpler solution to the following problem. Here is my setup:test <- tibble::tribble( ~group_name, ~id_name, ~varA, ~varB, "groupA", "id_1", 1, "a", "groupA", "id_2", 4, "f",...
View ArticleHow is possible that X is acting like a vector and a concrete variable at the...
I'll use the following code example:minmax_norm <- function(X) { (X - min(X))/diff(range(X)) } dSeeds_minmax <- apply(dSeeds,2,minmax_norm) How is possible that X is acting like each column of...
View Articleconvert df from factor to numeric
I am struggling to convert my dataset into numeric values. The dataset I have looks like this: customer_id 2012 2013 2013 2014 2015 2016 2017 15251 X N U D S C L X1 - X7 are marked as factors. The...
View Article