Correct way of calculating the roll of an animal using 3d acceleration?
I placed an accelerometer to several fishes in a field experiment to understand some of their behaviours. What I got was values of raw acceleration (X, Y, Z) of the fishes. This raw acceleration is...
View ArticleR: unexpected `ifelse` behavior
I have a data frame like the following:mydf <- data.frame(letter=LETTERS[1:10], val1=sample(1:1000, 10, replace=F), val2=sample(1:1000, 10, replace=F)) > mydf letter val1 val2 1 A 877 250 2 B 554...
View ArticleTranslate Negative Binomial Type I and II dispersion model from glmmTMB to JAGS
I want to translate a nbinom1 model from glmmTMB to JAGS. But I don't know how to translate the dispersion formula to JAGS. For this example I use the nbinom2 because it is simpler but actually I would...
View ArticleShiny Dashboard- How to add text for Sidebar items
I was trying to add website information on my shiny dashboard and for the "About" section (See image) I want few lines to be displayed on the dashboard body when clicked on that tab. how could i...
View ArticleFunction with different sources in R
here is a sample code : While I run the code without the function by entering for example : x <- 5 The code runs perfectly without any errors. Moreover when I try to call x with a function, it seems...
View ArticleAligning Effect Size Plots in R Markdown (using SJplot)
I think part of this question deals with sjPlot package, but I've found the package to be pretty flexible and to mirror ggplot, so I'm hoping someone has the answer.If you knit the code I've written...
View ArticleStepwise regression cenreg NADA library - R
I'm using the NADA package to fit left-censored data. After the fit I'd like to perform a stepwise regression to reduce the full model. While the cenreg function relies on the survreg command (from...
View Articlefor loop: performing cointegration test for all possible combinations in R
I'm new in programming, so it might be something which is done easily. I am trying to figure out if I can find cointegration for each combination of non-stationary time series with the ADF test. This...
View ArticleAre there any multilayer neural networks in R that can work with factor...
I need to solve classification problem with neural net in R. There are several factor variables in my data. I know that nnet can deal with factors but it has only one hidden layer. I wonder if there...
View ArticleHow to get the actual class and the prediction class for all data in R?
I create the model and do the predicition with this script in R,model = C5.0(dataset1[1:100, -7], dataset1[1:100, 7]) if I run summary(model), the output is just confusion matrix and the decision tree....
View ArticleInstalling Tidyverse on a work laptop (very controlled settings)
I'm hoping someone can help. I've finally convinced our IT team to let us install R so I don't have to use my personal laptop (which causes its own issues as I don't have access to our SQL database on...
View ArticleFirth's Logistic Regression
I am trying to find predictors for people selling their cars by doing a logistic regression. My sample size is n=922 and has mostly kardinal and ordinal variables. Since some of my variables have up to...
View ArticleHow to remove NAs with the conditions in R?
I'd like to remove some rows with the condition. Here is my data:df_A <- tribble( ~product_name, ~id, ~clicks, "A", NA, 1, "A", 4, 1, "A", 3, 1, "B", NA, NA, "B", 6, 2, "C", NA, 3, "C", 5, NA, ) For...
View ArticleMutate a column based on the sum of specific rows from another data frame
I am looking for some help here. I have two data frames, df1 and df2. I want to add an extra column to df1, based on the sum of specific rows in df2.Df1 contains station names. Df2 contain locations,...
View ArticleHow does the function pcf.ppp() differ from pcfinhom() in spatstat?
In spatstat the function pcf.ppp() estimates the pair correlation function g(r) by kernel smoothing. Hence, "the estimation of the intensity also plays an important role in the estimation of the pair...
View ArticleCheck if working on databricks notebook or ont
For some functions I need to split logic for databricks notebook with big cluster and for local machines. So is there a way to check, if R runs on databricks notebook. Like some tag in Sys.info() or...
View ArticleTranpose the duplicated row with unique value and assign the value of element...
I have dataframe where the column 3 as duplicate value. Value in column V3 has to be done transpose with unique value of it. Once the transpose is done i need to copy the element of column V4 matching...
View ArticleR - GBM | Data making trained GBM model very heavy
We are using GBM model to train on really voluminous data ~15GB. The trained model size becomes huge ~17GB. In the trained model we see data saved along with trees and other model details, taking...
View ArticleError in match(x, table, nomatch = 0L) : 'match' requires vector arguments
I am trying to do some Bioconductor exercises on R studio cloud. Running the first two codes (#1,#2) have been fine, but the last code(#3) gives the error message. Please can anyone help?#1 Transcribe...
View ArticleError "not numeric" when using crosstalk package with EnhancedVolcano
I'd like to implement a cross-talk functionality between a table and plot in both directions: 1) select the row in the table which will be reflected in the plot, 2) select a dot in the plot which will...
View Article