49 questions from the last 7 days
0
votes
0
answers
30
views
how to read_html https://finngen.gitbook.io/documentation in r
I use
read_html("https://finngen.gitbook.io/documentation")
with error
Error in open.connection(x, "rb") : cannot open the connection
however i can oepn https://finngen.gitbook....
Advice
0
votes
0
replies
35
views
Find and process @concept tags in .Rd files
In several packages, I've added @concept tags to Roxygen documentation for datasets. I'd like to process these to create a datasets.csv file for the package, that would include these as tags for each ...
0
votes
2
answers
54
views
Control levels the marginaleffects library uses when stratifying a numeric variable
I'm trying to use the marginaleffects library in R to get the estimates of a bunch of interaction effects from a bunch of different models. When I pass it an interaction that has a continuous ...
0
votes
0
answers
68
views
Reuse function in a package
I'm trying to reuse a function from one of my packages that installs the latest version of my package in another package. The original package is {pkgA} and the function is update(). The function uses ...
0
votes
0
answers
118
views
Problems with data visualization in R [closed]
I am working with the following code:
library(sjPlot)
daten_short1<-structure(list(AR = c(0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1,
0, 0),
...
3
votes
1
answer
51
views
How do I apply a font style I created to a range of cells with openxlsx2?
I want to apply a format I created using the create_font method to one or two ranges of cells, but I can't figure out how to use it. I've tried many ways, but unfortunately, without success.
My goal ...
Best practices
0
votes
3
replies
73
views
How do I count values in one column depending on values in another column?
What I have:
I have a dataframe with approx. 20,000 data records.
In the first column are the names of employees ... in the second the value “participated” or “did not participate”.
Each row ...
3
votes
1
answer
59
views
How to use Times New Roman and italicization in equation in ggplot2?
I need all text in my graphs to be in Times New Roman. I also need the variables (R, P) generated in stat_poly_eq to be italicized. However, it seems that setting the font to Times New Roman ...
2
votes
2
answers
72
views
How to run function multiple times, on different arguments/groups
I'm currently teaching myself R, and I'm attempting to write code to give me a population estimate of different fish species in different stretches of a stream (Site) over during different periods of ...
Advice
1
vote
2
replies
102
views
Generating Random Polygons in R
I need help coming up with a spatial workflow in R, or to be pointed in the direction of a package or something, I have no idea where to start with this.
I have a raster called "Suit" (epsg:...
-1
votes
0
answers
66
views
Problems with creating Mosaicplots in R [closed]
I am using the following R code:
library(reshape2)
library(rvg)
library(officer)
library(ggmosaic)
library(ggrepel)
x <- matrix(c(212, 256, 144, 707), 2, 2)
dimnames(x) <- list(Measurement_1 = ...
-1
votes
0
answers
55
views
Issues installing ArchR [closed]
I'm trying to install ArchR to replicate Step 2 in this GitHub repo
I am following the Installation of ArchR steps, but when I execute this line:
devtools::install_github("GreenleafLab/ArchR"...
1
vote
0
answers
44
views
Error with Random Intercept Model Using nlme and Custom Function
I am working with a custom logistic function:
logistic.fcn <- function (x, y0, y100B, dy100.F, a, x0B, dx0.F, isF_num) {
y0 + ((y100B + isF_num*dy100.F)-y0)/(1 + exp (-a * (x - (x0B + isF_num*...
0
votes
0
answers
85
views
Discrepancy between plot and actual data point [closed]
For whatever reason, the last point in the platelet data goes down instead of up when I plot it. Any ideas? I've redone EVERYTHING and it won't change.
Here's my code:
dates2 <- as.Date(c("...
0
votes
1
answer
100
views
Integer or Double vector? [duplicate]
print(krit)
names weight
1 may 36
2 mayer 49
3 mayo 35
4 mali 50
> mean(krit$weight)
[1] 42.5
> typeof(weight)
[1] "double"
> typeof(names)
[1] "character&...
1
vote
1
answer
97
views
stat_ellipse() in MCA plot does not cover jittered points / extends far beyond the data
I am creating a Multiple Correspondence Analysis (MCA) plot in R using FactoMineR, factoextra, and ggplot2. The goal is to add confidence ellipses around the archetype categories in the MCA space.
The ...
1
vote
0
answers
36
views
What does "Error in UseMethod("mutate")" mean, returned from `DHARMa::simulateResiduals()"?
library(glmmTMB)
library(dplyr)
library(DHARMa)
ml <- glmmTMB(menthlth ~ sex + medcost + ...,
ziformula = ~ sex + medcost + X_educag + internet + ...,
data = ...
1
vote
3
answers
124
views
Time difference between first and 2nd event by ID
I want to create a variable with the difference in days between the first and second dates by ID.
MRE
set.seed(5)
MRE <- data.frame(ID = c(1,1,1,2,3,4,4,4,5,5),
dates = sample(seq(...
1
vote
0
answers
59
views
FlowSOM randomly stops because of missing consensus.pdf
I am using FlowSOM() Clustering from the FlowSOM and am getting an error while a vectorized function is running:
Error in map2(): ℹ In index: 8. ℹ With name: FileID8. Caused by error in map() at ...
3
votes
1
answer
94
views
step_rename does not work like dplyr::rename
With dplyr::rename I can rename columns if they exist:
library(dplyr)
df <- data.frame(a_old = 1:3, b_new = 11:13)
lkp <- c(a_new = "a_old", b_new = "b_old")
df %>% rename(...
Advice
0
votes
2
replies
93
views
Force all character columns in a list of data frames to UTF-8 before uploading to a UTF-8-only database
I have a list of two tables in R.
Each data frame contains several character and numeric columns. One of the columns is a company name column (for example, Company_Name).
The target database only ...
-5
votes
0
answers
83
views
Reading multiple Excel files with multiple worksheets in R [closed]
I have to read around 80 Excel files with multiple worksheets. They are questionnaires that are all formatted the same way and where there is one column for the question, one for the question_id, one ...
-2
votes
1
answer
165
views
Error for concatenations longer than 100 variables [closed]
I was concatenating a large number of variables by name, each variable represents a number:
c(var1, var2, var3, var4, .... var300, var301)
It gave error "unexpected symbol" referring to ...
-1
votes
0
answers
55
views
Writing an excel file in R based on the name of a string [duplicate]
If a list of multiple dataframes (ListA), I can write an excel file doing the following: -
write_xlsx(ListA, "Results_Up_Until_20_10_25.xlsx")
The problem with this that the date will change,...
4
votes
2
answers
91
views
kable_minimal() giving stripes in Quarto table HTML output
I have a Quarto doc rendering to HTML written in R and I would like a table without stripes. All of the kableExtra tables give me stripes. How do I get rid of the stripes?
---
title: "Test"
...