Why is stat = "identity" necessary in geom_bar in ggplot?
From this question we see a simple geom_line in the answer. library(dplyr) BactData %>% filter(year(Date) == 2017) %>% ggplot(aes(Date, Svartediket_CB )) + geom_line() If we change geom_line to...
View ArticleCalculating means for trimesters from an array with monthly values
I have a large array with monthly precipitation values (dimensions=144(longitude)*72(latitude)*395(time)), where time starts at 1979-01-03 (year/month/day) and ends at 2011-11-03.I need to calculate...
View ArticleSplit a Matrix into multiple parts using assign in a loop
i have a matrix, consisting of monthly values from 2004 to 2018. i would like to split and save these into the individual years with the corresponding months. Like this...Sigma.ma2004 <-...
View ArticlePersistent volumes with docker-compose and RStudio/Jupyter
I am trying to create an RStudio instance and a Jupyter Notebook instance using docker-compose building an image. I can create these instances but the volumes mounted do not seem to be...
View ArticleHow to Create Spillover Table using FastSOM Package in R?
i work with stock return prices of Banks to create a spillover table that shows the connectedness between those banks. The cov- matrix is already created (Sigma). Since i am still a beginner, i have...
View ArticleFilter out both copies of duplicated files in a vector with dplyr
I'm processing files in a directory to convert a .raw filte to .wav. The output goes in the same folder and I need a way to generate a list of raw files that don't have a corresponding wav.e.g convert...
View ArticleHow do I add control variables when doing SEM in lavaan R?
I was wondering if there is a function to add control variables when doing SEM in lavaan conveniently in R?I would like to test the mediation effect of WE between OSE and IWB. However, if there is...
View ArticleRequest the value of a grid point of raster knowing its coordinates in R
I have a raster map (a digital elevation model) that i opened in R and I need to know the value (which is the altitude) of one specific grid point knowing its geographical coordinates. I've tried to...
View ArticleHow to fix "invalid return_url" error when creating oauth token for Trello...
I want to manage my Trello cards and boards using the trelloR package but when I try to create a token with the get_token function, I get an error message on my browser : "Invalid return_url".my_token...
View ArticleHow to convert multiple defferent correlation matrix in dataframe by pairs in...
I want to convert the multiple correlation matrix into dataframe at the same timemy matrix group like this: [the output I want like this: my current code is like this:dat1 <- read.xlsx("correlation...
View ArticleR taskscheduleR not executing script
I'm trying to run a script once every minute using taskscheduleR library. I'm following the examples from the GitHub page but am runing into the following problems: R says task created but the script...
View ArticleIdentify regions of zeros that are surrounded by ones in a matrix
I have a list of binary matrices. In each matrix, I want to detect regions of white pixels (0) surrounded by ring (a chain) of connected black pixels (1).For example, in the matrix below, there are two...
View ArticleHow can I add a subplot within a plot using levelplot in R?
I would like to add a subplot in my main levelplot, something similar to this image. I want lat/lon axis for both my maps but I have not managed to find a way to do this with the levelplot. Also, I've...
View ArticleHeader in Rmarkdown is not displaying in a required format
In the html report, It is looking like thisWhat could be the problem here?...Header is not displaying in a required format
View ArticleR: Loading a code not working even if I follow online code
I am trying to load the global terrorism data into R. I follow this code:https://www.kaggle.com/josephgpinto/terror-attacksBut you can try downloading the CSV yourself and realize that the code in that...
View ArticleHow to Classified the text description using Machine learning in R/Python?
I want to build a machine learning Description classification model according to their labels in R\Python,Since there are multiple labels for each Description, so I am little bit confused, which ML...
View ArticleError: number of observations in y not equal to the number of rows of x
ames_train_x <- model.matrix(Value ~ ., train)[, -1] ames_train_y <- log(train$Value) ames_test_x <- model.matrix(Value ~ ., test)[, -1] ames_test_y <- log(test$Value) # Applying LASSO...
View Articlecaret Confusion Matrix: Error in table(data, reference, dnn = dnn, ...) : all...
I have an academic problem and I am trying to run a confusion matrix on a decision tree prediction on my test set. When I run the confusion matrix, I receive the error: Error in table(data, reference,...
View ArticleIs there an R-package to calculate pseudo R-squared measures for conditional...
Is there a R-package to calculate pseudo R-squared measures for my model? rcompanion neither supports clogit nor bife (due to missing intercept?).Originally that was one question out of a larger...
View ArticleWhat is the best model for this data and question?
I have a dataset consisting of customer data of an e-commerce website and deals that have been shown to them for each item, the price of each item, the items they clicked on and the items they...
View Article