Stay up to date
We'll highlight new content in your collectives with a blue activity indicator on navigation items and posts.
Manage preferences
Questions
Browse questions with relevant R Language tags
75,649 questions
No answer
0
votes
0
answers
4
views
Which versions to install to make RandomFields, RandomFieldsUtils, rpy2 compatible?
I am hoping to install some packages that people no longer update.
I need RandomFields (https://cran.r-project.org/src/contrib/Archive/RandomFields/), RandomFieldsUtils (https://cran.r-project.org/src/...
0
votes
0
answers
11
views
Is there an R program that plot ROC curve nicely?
Is there any package that allows me to plot ROC curve like this? ?
The 0.95,0.9 are particular threshold values.
I tried the package verification with roc.plot(truth,v,xlab="FDR",ylab="...
0
votes
0
answers
19
views
How can I append duplicated groups of a dataset with changes to existing data in R efficiently?
I have data like this:
key_data <- data.frame(orig_letter=c("A","A","A","A","C","C","F","B","B","B&...
0
votes
0
answers
11
views
Capture legend event shiny echarts4r
Is it possible to capture a legend activation / deactivation event of a echart in RStudio using a shiny app?
mtcars |>
head() |>
tibble::rownames_to_column("model") |>
e_charts(...
0
votes
0
answers
16
views
'Maximum call stack size exceeded' when using tsibble::fill_gaps() in a shinylive webr app
I am using shinylive (v0.2.0) to write a Shiny (v1.8.1.1) app to run in the browser (Safari v17.5, 19618.2.12.11.6) using webr. The app takes data where each row represents an event and counts the ...
1
vote
0
answers
26
views
Combine event binding and dynamic outputs in shiny
My Shiny app consists of selecting a set of parameters to generate outputs based on the corresponding data, where each parameter is dependent on the previous one to narrow down which data needs to be ...
0
votes
0
answers
38
views
Element does not exist in dataset when selected via selectInput
In the shiny app below I try to group by selected input but I get:
Caused by error in `all_of()`:
! Can't subset elements that don't exist.
✖ Element `abs_edu` doesn't exist.
This is my code:
library(...
0
votes
0
answers
35
views
Problem with dynamic linear model -> lagged variable explains 100% of my model
So i have created a regression, which regresses a cycle component onto a lagged cycle component and various other variables.
It looks like this:
regoffice4 <- dynlm(
diff(diff(officecycle,1),1) ~ ...
0
votes
0
answers
41
views
Create a function that converts a dataframe into a format suitable for a treemap structure
I want to create a treemap for a dataframe using the Plotly package. For this purpose, I need to create a function that converts the dataframe into a format suitable for a treemap structure. On the ...
0
votes
0
answers
18
views
ggplot line plots are not showing up on proportional secondary axis
I am trying to plot a barplot, and overlay some plots onto it using a secondary axis. I am able to adjust the secondary axis to be proportional to the values but the line plots still seem be squished ...
0
votes
0
answers
19
views
R shiny app - rendering is much slower when run on remote server compared to local server
I made an R shiny app which runs perfectly in my local browser on my local server, however the rendering is noticeably slower when I run the same app from my local browser on a remote server. A quick ...
0
votes
0
answers
22
views
Issue with Residual Plot Pattern after Fitting beta_family Model in glmmTMB
I'm working with proportion data and have tried several models to address issues of overdispersion and underdispersion. Initially, I used a binomial distribution model which showed overdispersion. ...
0
votes
0
answers
10
views
Grab the user details when a user authenticates an R shiny web app using Azure Active Directory
I am new to the concept of web apps deployed in Azure and related authentications.
I have an R Shiny app, hosted as an app service in Azure cloud using Docker containers. I have few Azure user groups ...
0
votes
0
answers
11
views
Error when using diagnose function from glmmTMB
I'm using glmmTMB (version 1.1.9) to run a step selection analysis with the two-step approach suggested by Muff et al. 2020 (fitting a Poisson model specifying a stratum-specific fixed intercept) ...
0
votes
0
answers
55
views
Dealing with duplicate rows when creating a visit column, cartesian multiplication
I'm having trouble with data transformation.
What I want to do is go from a data table that created Cartesian multiplications to one that is sorted by column of visit number.
The logic:
this is a ...
0
votes
0
answers
17
views
Multilevelannotation function error in xMSannotator package. Error in hclust() NA/NaN/Inf
I have been trying to use the multilevelannotation function within the xMSannotator package to process mass spectrometry data. This package can be accessed through using:
install.packages(c('...
0
votes
0
answers
28
views
Changing label colors in gge plot
I'm trying to change the color of the labels and it seems that the input of vector of colors works for lines and not for labels and the label color is just the first color of the vector list.
Maybe ...
0
votes
0
answers
19
views
RStudio can't open specific project: system error 10053
I am using Windows 10. I recently tried to update R from 4.3.0 to the current version 4.4.1. Since then, I can't open one of my projects anymore. This project uses version control (GitLab) which I ...
0
votes
0
answers
27
views
Maximum Number of Threads for Parallel Computing in R: Is it 128?
I am using R for parallel computing on a machine with the following specs:
2 x AMD EPYC 7K62 CPUs
48 cores and 96 threads per CPU
Total: 96 cores and 192 threads
I am trying to utilize all available ...
0
votes
0
answers
19
views
Significance vs Correlation in PCA using DEGreport (differential gene expression)?
I have done a differential expression analysis in EdgeR, including some biological and technical coefficients in the linear regression model.
Reading around online, principal component analysis seemed ...
0
votes
0
answers
13
views
How to pass parameters to sparkR::sql() using dbutils widgets
I am working in databricks using widgets to parameterize my notebook. I want to then pass the widget values as parameters in my sql query using sparkR::sql() to filter my table on. Here is my code:
#...
0
votes
0
answers
9
views
ROSE package in R not reading variable correctly; does not read updated value contained in variable
I'm hoping to receive some help here as I've struggled for a while now and I cannot figure out the problem.
I am using the ROSE package in R, attempting to make use of the function for random over/...
0
votes
0
answers
38
views
mutate() error - Index 1 must have length 1, not 13
My goal is to show multiple plots of residual vs. fitted values for a dataframe of 13 stations each having a separate lm() model. Working from an example in Chapter 25 (Many Models) in the R for Data ...
0
votes
0
answers
25
views
Identify points lying on transects from a spatial dataframe in R
I have survey data, with recordings every 1 NM along parallel transects perpendicular to the coast. For each record I have information such as latitude and longitude, speed, bearing. Along the ...
0
votes
0
answers
18
views
Error: coef/vcov not consistent with basis matrix. See help(crosspred) in interaction analysis in DLNM package
I am trying to do an interaction analysis using gnm in Distributed Lag Non-Linear Model (dlnm) library. My script works fine in its simple form with effect and crossbasis of exposure as well as with ...
0
votes
0
answers
20
views
Using GEE with "geepack" for survey data that includes time-fixed covariates
I want to use Generalized Estimating Equations (GEE) to model longitudinal survey data. Participants' responses were recorded at three timepoints, and I have multiple independent variables (which are ...
0
votes
0
answers
17
views
How to use rpart to calculate predicted probabilities for multi-class decision trees?
I am using iris as an example to build a multi-class decision tree in R using rpart function. The outcome is transformed into numeric numbers. I want to get the predicted probabilities for the three ...
0
votes
0
answers
28
views
PISA 2022 data R Support
for my dissertation I am using the PISA 2022 dataset. I am using RStudio for this purpose. I am not good at R (I am a humanities student who did a conversion data science degree, which I regret as I ...
0
votes
0
answers
16
views
Problem with spatial autocorrelation measurement for predictor rasters in blockCV::cv_spatial_autocor()
I’m encountering problems with the cv_spatial_autocor function from the blockCV package. This function is used to measure spatial autocorrelation in spatial response data or predictor raster files. It ...
0
votes
0
answers
23
views
Chunk produces "Failed to create SQL chunk directory", then runs the 2nd time
I have a notebook that queries our Snowflake instance. Oddly, the first time I run the SQL chunk it fails with an error, "Failed to create SQL chunk directory". If I immediately run the ...
0
votes
0
answers
11
views
How to use plot.metaMDS
I have result of a NMDS using metaMDS() and I would like to plot my species ordination plot using a grouping variable in my environmental data.
So I am wondering what determines the colour of the ...
1
vote
0
answers
31
views
Find the portfolio with the maximum return at a given risk level using the `fPortfolio` package in `R`
I’m trying to find the portfolio with the maximum return at a given risk level using the fPortfolio package in R. However, there appears to be a bug in the package that the optimal portfolio (based on ...
0
votes
0
answers
19
views
How to save a calculated variable as a new variable?
I am writing an extension for K-means in SPSS (in R language). I have successfully written the code to calculte K-means and now I want to save a number of a cluser as a new variable, but I don't know ...
0
votes
0
answers
30
views
In arrow/`open_dataset`, when transfer to data.frame , show error message `CSV conversion error to null`
In arrow/open_dataset, when transfer to data.frame , show error message CSV conversion error to null . How to fix it ?
seems add parse_options = csv_parse_options(newlines_in_values = TRUE) can't work ...
0
votes
0
answers
19
views
In R/arrow package, function read_csv_arrow show error Invalid: CSV parser got out of sync with chunker
In R/arrow package, function read_csv_arrow show error message Invalid: CSV parser got out of sync with chunker . How to fix it ?
library(arrow)
arrow_table <-read_csv_arrow("sample.csv&...
0
votes
0
answers
21
views
How to obtain standardized residuals for clustered data in lavaan?
I am facing a problem concerning the output of standardized residuals for a fitted lavaan (sem)-object. As far as I do not include “cluster = ” in the fitting function, I can easily obtain the ...
0
votes
0
answers
25
views
Unable to upload Excel File without updated version of Rcpp
I am unable to load my excel file on R as it gives me the error below:
"Preparing data import requires an updated version of the Rcpp package. Do you want to install this package now?"
When ...
0
votes
0
answers
36
views
Keep getting error running this script for stock screening and analysis
The script is meant to extract list of stocks symbols and its corresponding data for analysis but i keep getting error when i get to the map section of the code. The script is given below:
{
...
0
votes
0
answers
13
views
OTU data into box plots
I am trying to create a box plot of the relative abundance of a taxa controlled for a Vitamin D condition.
For example a boxplot with the relative abundance of Bifidobacterium, one boxplot for Vitamin ...
1
vote
0
answers
24
views
Two dropdown menus to select Y and Y2 axes independently
I am trying to generate a plot which has independent dropdown menus for both Y and Y2 axes. I am able to implement a dropdown for either the Y1 or Y2 axis when the other is static. I have also ...
0
votes
0
answers
30
views
RMarkdown issue: {r child = here::here("scripts","rmd","analysis-part000.Rmd")}
I'm trying to clean up a long RMarkdown document based on this article that uses here::here() to dynamically build the folder structure from the base folder of the project.
My code successfully ...
0
votes
0
answers
24
views
Error in Boosted Regression Tree model with offset
I'm working with boosted regression tree models (BRTs) to predict the probability of occurence of a dolphin species. For that I have presence/absence data and several environmental variables. The ...
0
votes
0
answers
16
views
Why are the YAML highlight options not being reflected in my HTML that is knitted from and RMD?
I am working in r studio. For my college class, we're working in rmd files and then knitting them to html files. Each rmd file starts with YAML options that setup the document. The document has no ...
0
votes
0
answers
44
views
Is there a way to build a 360* plot in r?
This is all i have so far:
data2 <- data.frame(time = c(ts_nodates), bearing = c(T6PO_Clean$bearing))
ggplot(data2, aes(x = bearing, y = time, fill = factor(bearing)))
+ geom_col(width = 5) ...
0
votes
0
answers
32
views
Create a radarchart with dynamic grouping which is based on shiny widget
This is a shiny app in which first I need to select 3 or more columns from the selectinput() named Variable and then 1 from the Group selectInput().The first works as with this I set which variables ...
0
votes
0
answers
15
views
How to apply cld() on specific groups of lsmeans() output?
I have a pretty large model (MLM_LAI_10_DIC), with more than 7000 values. When I use cld() on lsmeans() on my model, I get too many groups. Is there any way to apply cld() on just some of the values? ...
0
votes
0
answers
36
views
How to get VennDiagram to include 0s
I am trying to work out how to create a Venn diagram using the VennDiagram package that keeps 0s in. At the moment I have the issue below where if there is not overlap between the groups the circle is ...
1
vote
0
answers
29
views
Extract the Variables with the Most Influence on the Ordination in an LDA
I performed an LDA analysis on my data, and I want to extract the variables that most impacted the ordination. If I understood correctly, I can obtain that information from the "scaling" ...
0
votes
0
answers
20
views
SVC GAM in the presence of factor variable and transformation of coefficients into relative risk
I would like to get your confirmation on two doubts I have on the application of SVC GAM.
Basically, I would like to know
how to deal with factor variables when predicting spatially varying ...
1
vote
0
answers
15
views
Sommer Package: mmer prediction error because of singular matrix
I am running a GxE mixed model in Sommer, with the environments as a fixed factor and genotypes as a random factor with a GRM as covariance structure (G_GY). For the interaction term, the covariance ...
Members can contribute articles
Simply submit a proposal, get it approved, and publish it.
See how the process works
Simply submit a proposal, get it approved, and publish it.
See how the process works