plot coordinates from two vectors into a 0,1 matrix
I have two vectors of equal lengtha <- 1:10 b <- sample.int(10,size=10) I would like to plot them into a matrix of the same length (10) where a is the row coordinate, b the column coordinate,...
View ArticleDodged dumbbell plots with ggplot2
This question is based on this prior question.Consider the following plot: Domain = c("A", "B", "C", "D", "E", "F", "G", "A", "B", "C", "D", "E", "F", "G", "A", "B", "C", "D", "E", "F", "G", "A", "B",...
View ArticleR bootstrapping resampling with multiple observations per id and return the...
I'm trying to do a bootstrap for my data. My data (df) has the following shape.id v1 v2 1 1 1 1 0 1 1 0 1 2 2 0 2 1 1 2 0 0 As far as I understand, when initializing the bootstrap in R, the resampling...
View ArticleR Shiny Dynamically add textinput and print ui output based on Userinput
I am trying to create a shiny application which will enable users to add text boxes, or add images and create a document from it. I am able to add one Textbox and display its contents but when I add...
View ArticleWhy do i lose my date index in this r script, calculating returns?
We have used dplyr for this specific problem and found a helpful script online for the task at hand the only problem is that this script keeps removing the time index which we need later on. The script...
View ArticleDetermine if a vector is ordered
I would like to determine if a vector is either always increasing or always decreasing in R.Ideally, if I had these three vectors:asc=c(1,2,3,4,5) des=c(5,4,3,2,1) non=c(1,3,5,4,2) I would hope that...
View ArticleGetting error message "Error in checkFunc(Func2, times, y, rho) : Model...
I am working on a model to predict the incidence of an infectious disease and have a model for it which was functioning well till yesterday. Now I get the message: Error in checkFunc(Func2, times, y,...
View ArticleAll the membership degree matrix element show the same proportion for each...
I am implementing fuzzy c means in R (centers=2) based on this website do https://cran.r-project.org/web/packages/ppclust/vignettes/fcm.html. The difference is I am using my own data, consist of...
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 ArticledeSolve Installing package error
I am installing deSolve package, in R, linux mint. The following error stops installing: /usr/bin/ld: cannot find -lblas collect2: error: ld returned 1 exit status make: *** [deSolve.so] Error 1 ERROR:...
View ArticleR Splitting strings by multiple splitting criteria and storing the splitting...
I'm trying to split a string by multiple criteria and store the splitting criteria for each split.I have been trying to use the stringr::str_split package but cannot pass more than one splitting...
View ArticleHow to set column width in R Shiny data table?
I am building a Shiny dashboard displaying a DataTable.My objective is to have the column width of data table automatically adjusted to fit the cell values in 1 line instead of multiple lines. However,...
View Articleggbiplot - How to change the position of arrow labels
we have the results of a PCA done with prcomp(). Afterwards we plotted the results with : ggbiplot(PCA_Hochfl, labels.size = 2, varname.size = 3.5, cex=c(5,1)) + geom_point() +...
View ArticleREBayes Error in KWDual MKS_RES_TERM_STALL
I am trying to run the following simulation below. Note that this does require Mosek and RMosek to be installed!I keep getting the error Error in KWDual(A, d, w, ...) : Mosek error: MSK_RES_TRM_STALL:...
View ArticleCan't install tensorflow in R, my machine is 64 bit but R doesn't detect it
I'm using windows, my problem is that while trying to install tensorflow in R the following error message appears.Error in install_tensorflow(method = method, conda = conda, version = tensorflow, :...
View ArticleHow to calculate a variable that select the maximum range value out of...
I have a dataframe df that summarizes hourly water temperatures at different depths (5 meters T5, 15 meters T15, 25 meters T25 and 35 meters T35) over several months. As an example:df<-...
View Articlemissing values in dataframe by loop
I have full dataframe. I want using loop check each value of var1 variable, if his value is missing or not. If his value is missing i want to do some actions.I know that i can check var1 is missing by...
View ArticleUnable to install R package - Warning in system(cmd) : 'make' not found
Error installing package 'nlme':installing source package 'nlme' ... ** package 'nlme' successfully unpacked and MD5 sums checked ** using staged installation ** libs Warning in system(paste(cmd,...
View ArticleHow to read json data from list of URLs and tidy it into a dataframe?
I am using the help of https://ipstack.com to geocode IP addresses and am having a difficult time trying to geocode all 1200 addresses in a short amount of time. With R, I've collected the URLs into a...
View ArticleHow to exclude outliers individually for target & participant in R
I'm (very) new to R, and I was wondering if I could get some help. I'd like to know how to exclude outliers that are two standard deviations for each participant's mean reaction time, and each target's...
View Article