Questions tagged [r]
R is a free, open-source programming language & software environment for statistical computing, bioinformatics, visualization & general computing. Please use minimal reproducible examples others can run using copy & paste. Show desired output entirely. Use dput() for data & specify all non-base packages with library(). Don't embed pictures for data or code, use indented code blocks instead. For statistics questions, use https://stats.stackexchange.com.
507,892
questions
0
votes
0
answers
3
views
Annotating phylogenetic tree with images from PhyloPic in R
Can someone please help me to resolve the error message that appears?
library(ape)
library(ggtree)
library(dplyr)
library(ggplot2)
library(ggimage)
set.seed(123)
tree <- rtree(15)
plot1 <- ...
0
votes
0
answers
4
views
Collapse messages and text output and add a scrollbar to chunk output when writing vignettes in Rmd
I'm writing vignettes on RStudio using Rmarkdown and knitr for an R package that I'm developing. In one chunk, I'd like to demonstrate the operation of a function I wrote and show its output. ...
0
votes
0
answers
5
views
Reticulate py_config() returns error, python310.dll - The specified module could not be found
Here's the code I'm running.
library("reticulate")
virtualenv_create("r-reticulate")
use_virtualenv("r-reticulate", required = TRUE)
Sys.setenv(RETICULATE_PYTHON = "...
0
votes
2
answers
22
views
Using cat() inside warning() puts the message before the warning
I used cat() to create a warning message, but in the result the warning message comes before the "Warning message:" part. Is there a different way to create this warning message so that it ...
0
votes
0
answers
16
views
How do I compare which interaction term in a model is the stronger predictor? [closed]
I am running a regression model with several independent variables and two separate interaction terms, along with country fixed effects and clustering the standard errors at the individual level. The ...
0
votes
1
answer
12
views
How do address MathJax down with RShiny
I woke up this morning to a new issue where previously working code with Mathjax was working, but now it is not. It appears the issue is broad. I reproduced it on several machines, which is also an ...
0
votes
1
answer
8
views
Function works with plan(sequential) but not plan(multisession)
Here is my code :
plan(multisession,workers=detectCores()-2)
future_map_dfr(.x= Liste_model[1:2],.f = summaryModel, df = DF_MODEL_TRAIN, df_test = DF_MODEL_TEST, df_global = DF_MODEL_GLOBAL, .id = &...
1
vote
1
answer
15
views
Forest plot with the forestplot() function
I am making a forest plot with the package forestplot and the function forestplot().
So far I have a plot that works, however, I would like to make some changes to customize it to my liking. So far ...
0
votes
1
answer
26
views
How can I hinder ggplot from overwriting arguments to default that have been set before?
I am frustrated from ggplot2 overwriting arguments that have been set before. In fact I encouter the described problem with different ggplot2 functions, but in order to illustrate what I mean I write ...
1
vote
0
answers
14
views
Upload an Image and have the title name using openai package in R
I am trying to upload an image and have the title description using the openAI packgae in R
library(openai)
Sys.setenv(OPENAI_API_KEY = "myopenAIkey")
image_path <- 'www/img/book1.jpg'
...
0
votes
0
answers
24
views
Creating subsections from variable
I would like to use categories in variable to create subsections in RMarkdown and display the results of each category in the given section....
This is the R script
library(rmarkdown)
library(dplyr)
...
-2
votes
0
answers
22
views
How to get all occurrences of a string using regex in R? [duplicate]
Let's say I have a string
Str1 -> "[18.01,19.023],[20.0289,20.9273],[32.474742,284.383732]"
This is like a set of coordinates of type [x,y] and I want to extract all the "x" and ...
0
votes
0
answers
27
views
Inferential statistics from co-occurrence matrix
I have made a co-occurrence matrix like the one in the pic below (numbers = percentages row-wise. So, out of all the times E was in a group, 8.17% of the times was with A, 7.36% of the times with B, ...
2
votes
1
answer
32
views
R and ggplot with st_crop: map cropping does not work as wanted
I am trying to plot only a part of the world map, limited by a square with limits lon (-30, 90) and lat (30, 82). When I try to crop the map with sf_crop, it does not return the desired square when ...
0
votes
0
answers
25
views
R stm plot.estimateEffect
The function plot.estimateEffect from the stm package allows users to plot the effect of a covariate on a set of topics selected by the user.
Methods used for plotting include "pointestimate"...