Output loop Kolmogorov Smirnov Test (ks.test) in dataframe
I would like to incorporate the output of a ks.test recorded in a loop into a data frame or file, instead of printing the outputs of 1155 tests in the console... :-). column_equality_stats =...
View Articleto predict values in lme4
I used library(lme4) to build my model. The model is modTTO <- lmer(as.numeric(`TTO value`) ~ mo2+mo3+sc2+sc3+ua2+ua3+pd2+pd3+ad2+ad3 + (1 | internal_id), TTO, REML=FALSE) Now I want to predict...
View ArticleR Shinydashboard: How to reference box in conditionalPanel() condition argument
I have a Shiny app where I would like to set a conditionalPanel() depending on whether the user selects a tabPanel from a tabBox. My question is how can I reference the panel the user selected. In my...
View ArticleBoxplots for linear regression
I have a very basic question: I have just run a multivariate linear regression in R, one of the independent variables being a dummy. How do I get separate boxplots for the regression, one for each...
View ArticleProportion of a image which is text in R
If I have an image, what syntax in R would give me the percentage of that image that is text? E.g. of the attached picture what percentage is the word 'CHANEL'
View ArticleUsing date as argument in exp()?
Working to eventually put an exponential fit on some data, but running into errors with the datatype of a Date object. How can I convert a vector of dates into a format that can be read by the exp()...
View ArticleHow to download data onto multiple sheets from shiny?
How can we download data from Shiny onto multiple sheets naming each sheet ?For example, below, ginberg saved the mtcars data in sheet1, can we save the head(mtcars) in sheet2 ? Also, can we name these...
View ArticleMark a period of time in a time-series-plot
First, let's create some fake data:d <- c("2019-01-01", "2019-01-02", "2019-01-03", "2019-01-04", "2019-01-03", "2019-04-06", "2019-04-03", "2019-05-07", "2019-05-03", "2019-05-03", "2019-05-03",...
View ArticleWhy rstudioapi::insertText don't write the text to the addressed place
I wanted to display characters on the r-console of rstudio at a certain point. However, the text is always output in the following empty line and not where it was addressed. When the output is...
View ArticleIs there a way to range rhandsontable side by side
I have a 2 rhandsontables r1 and r2 below. Is there a way to arrange these side by side?library(rhandsontable) library(knitr) library(kableExtra) library(RGraphics) y <- c(1:123) y <- ts(y, start...
View Articlein R, How to create function to create multiple textinput widgets from list?
using R Shiny, I am trying to create function to create textinput or selectinput widget for all list elements here is a example listxlist<-c("a","b","c")here is the textinput functiontextInput01...
View ArticleAutomate a R function t [duplicate]
This question already has an answer here:Using If else conditions on Vectors 2 answersI am trying to put a query in R for all my columns I want to create a new columns that will say impact or non...
View ArticleDeleting duplicated rows based on condition (position)
I have a dataset that looks something like thisdf <- data.frame("id" = c("Alpha", "Alpha", "Alpha","Alpha","Beta","Beta","Beta","Beta"), "Year" = c(1970,1970,1970,1971,1980,1980,1981,1982), "Val" =...
View ArticleHow ton extract both node names and their eigenvector centralities in a...
I need to create a datatable with both node names and their eigenvector centralities but the problem is that I cannot extract the node names and I use:#CENTRALITY library(igraph) library(magrittr)...
View Article* Plot is missing `lg ` Error in ggplot graph-making
I have been copying the code from: Chang, 2012, R Graphics Cookbook: Practical Recipes for Visualizing Data. pg, 46-47Which is this:ggplot(prac1, aes(x=pos1, y=pos2)) + geom_segment(aes(yend=pos2),...
View ArticleChange Line Colors Above Specific Values [duplicate]
This question already has an answer here:Plot with conditional colors based on values in R 1 answerlibrary(ggplot2) data = data.frame("person"=rep(1:2,4), "time" = rep(1:4, 2), "scores" = c(5,7,9,11,...
View ArticleWhy is the `==` function not suitable for this code and %in% is?
I have noticed that using %in% works instead of == before the c() function when it has greater than 3 objects. Can this be explained? == works fine when there are less than or equal to 3 objects in the...
View ArticleThe right way of to Plot Actual vs Predicted SVM Regression
I am building an SVM regression model using caret package, however, I am not sure what is the best approach to plot predicted vs actual values. I have the code below. You can reproduce the output by...
View ArticleHow to put legends on interactive ggplot2 heat map
library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base':...
View ArticlePlotting after Checking the radio Button and Pressing action Button
I have a dataframe, please help me in executing this. The moment I check "HoltWinters" and press "Execute" button, dataframe "HW" should appear. I have tried half way. But need anyone help here...
View Article