Loop through a list of dataframes output plots
I try to make function plots or my top 20 genes. That's why I created a list of data frames, these data frames exist or different columns contain values ​​and names. One of these columns in the data...
View ArticleWhy is my matrix being filled with NAs, not the output of the loop?
I am looking to fill matrix tab with the output of the look (variable ma), however instead it is filling the matrix with NAs MA<-data.matrix(my_data) MA2=MA[-247,-8] tab<-matrix(ncol=2,nrow=253)...
View ArticleglmmTMB with beta family
I am trying to model the photosynthetic response (fvfm) that takes values from 0 to 0.7, I am using the beta distribution since I have zero inflation, and I consider a dispersion model because my...
View ArticleExecuting R code deployed in Pivotal Cloud Foundry (PCF) from Java locally
I am trying to connect R code which is deployed in PCF from java code locally which is not working. My R project structure is mentioned below. It is working in local perfectly but not working...
View ArticleR how to turn lists to vectors, and why a list at all
I want to create a vector of dates, for which I created a simple loop which added the dates i am interested in to a vector. However, for some reason it turns it into a list.library(timeDate)...
View ArticleHow to write nested functions with dplyr and dots elipse?
I am trying to put this as simple as possibleSome sample data :library(magrittr) library(dplyr) library(rlang) # sample data tib <- tibble( a = 1:3, b = 4:6, c = 7:9 ) Now a function that makes the...
View Articleconverting date (month) only to XTS class in R
I have a csv file which I read in Rlibrary(xts) mydata <- read.csv("abc.csv") ==> it becomes a dataframe Months Round Premium December 2 1000 December 1 2000 November 2 1500 November 1 1200 ......
View ArticleHaving issues appending tab on cell click within observeEvent function in R...
This is the minimum reproducible example needed to help:ui.R library(shiny) fluidPage( title = 'DataTables Information', tabsetPanel(id = "tabs", tabPanel("Cars overview", h1("Cars overview"),...
View ArticleRecorder Dataset in R based on Country
structure(list(Date = c("KW 52 / 2016", "KW 1 / 2017", "KW 2 / 2017", "KW 3 / 2017"), Sales_AT = c(150L, 169L, 143L, 170L), Sales_CH = c(150L, 169L, 143L, 170L), Sales_GER = c(150L, 169L, 143L, 170L),...
View ArticleHow to select lines of file based on multiple conditions of another file in R?
I have 2 genetic datasets. I filter file1 based on a column in file2. However, I also need to account for a second column in file2 and I'm not sure how to do this.The condition for file 1 row...
View Articleunable to install R package "nloptr" (R3.6.2 on Ubuntu 16.04) - C++ compiler...
I'm having trouble installing the "car" package after upgrading R to 3.6.2 (from 3.4) on Ubuntu 16.04 due to (at least one) dependency (nloptr) that cannot be installed either. It seems to be a problem...
View ArticleDeal with outliers
I'm studying a dataset with a wide range of values (for example a varibale assumes values from 0 to 15mln). Obviously calculating principle descriptive statistics and plotting some graphs (for example...
View Articlechanging variables of a separate R script in a shiny app
I have a set of scripts which are run from below, with aspects of the final output influenced by lines 2-4setwd() inputyear = "" inputmonth = "" dataType = "" source("1.R") source("2.R") source("3.R")...
View ArticleHow to create Random Forest from scratch in R (without the randomforest package)
This is the way I want to use Random Forest by using the RandomForest Package:library (randomForest) rf1 <- randomForest(CLA ~ ., dat, ntree=100, norm.votes=FALSE) p1 <- predict(rf1, testing,...
View ArticleMariaDB ODBC driver for R gives strange results
There is a strange behaviour when importing data from MariaDB into R when using MariaDB ODBC 3.1.3 Driver. The table in DB I want to import is:+----------------------------+---------+-----+------+ |...
View ArticleEDIT: Data Added - dynamic pivot_longer and facet wrap ggplot
I have a data frame which looks like:# A tibble: 200 x 7 status logTA logSALES logTA_PredBrkDwn logSALES_PredBrkDwn Model Model_PredBrkDwn <int> <dbl> <dbl> <dbl> <dbl>...
View ArticleCount based on multiple conditions using sqldf
Hi all I'm writing a sql query on R using sqldf and seem to hit a roadblock. I have a table with an Id column, two dates columns and a grouping by column.AlertDate AppointmentDate ID Branch 01/01/20...
View ArticleHow to re-arrange data in a data frame in R?
I am working on a data frame from the following spreadsheet :enter image description hereThe output of my R script should look like the second picture : enter image description hereI am translating my...
View ArticleVectorizing which operation across the rows of a matrix
I would like to vectorize (apply) a which operation on matrix X as illustrated by the following for loop having as result the vector ind:X = matrix( 1:20, 4, 5 ) V = sample( 1:20, 4 ) ind = numeric()...
View ArticleHow to go about finding the slope of a series of observations, with different...
I have a dataframe that looks like this, where each observation is the size of a school's enrollment: Year1 Year2 Year3 Year4 Year5 Year6 Year7 Slope School1 89 87 74 64 0 0 0 School2 100 99 90 87 83...
View Article