Category "r"

How to plot multiple 1 dimensional scatter plot in R based on occurences of a specific value at a specific point of x-axis

I have these datas that determines how absence rate affect student's grade in 3 different years, im trying to plot a one dimensional scatter plot with the three

map function based on a column value of dataframes stored in a list

I am trying to use the map function to do something complex - I'd like to use the values of the Result column per each dataframe I have in a list ( these are m

Match text from one column with another column (vlookup + like)

I'm trying to perform a match of 2 columns but without success. I have one DF1 with 2 columns, Id and JSON. In the second DF2, I have one column with a pattern

Image not rendering in Shiny Server in docker

Background I'm using another docker image and installing Shiny Server via commands in the dockerfile. The images are in a subdirectory named "www" in the app.R

Remove a pattern from a character

I have a character like this: x = "abc [File: abcbdosln}} \n abc \n" And I want to remove File: abcbdosln}} \n from x so that the result would be "abc [ abc \n"

Flagging continuous observations and creating enrolment spans

I have a few large enrolment datasets and I'm trying to create two things: I'd like to flag each uninterrupted monthly observation (final_df1) I'd like to creat

Is it possible to disable the RStudio connections pane?

I wonder if we can disable the RStudio Connection Pane altogether? What I tried so far: untick Connection in Tools / Global Options / Pane Layout / upper right

R: Tetrachoric correlation for multiple variables at one go?

You can see I'm a beginner at this when I'm not even able to reproduce my problem with a dummy dataset... Anyways, here goes: I want to calculate tetrachoric co

R: Tetrachoric correlation for multiple variables at one go?

You can see I'm a beginner at this when I'm not even able to reproduce my problem with a dummy dataset... Anyways, here goes: I want to calculate tetrachoric co

scraping with rvest with different number of rows in r

https://www.transfermarkt.de/alexander-bade/profil/spieler/31 Is it possible to scrape the whole table in one scrape?

R studio: error message when I was trying to intall a package

I'm very new to R studio. Was trying to do my assignment, that need to install a package. But when I was doing so, an error message came out Here is the whole t

How to show labels inside a chart with R-plot?

I have the following chart in R: n = 1:50 f = log2(n) g = n h = n*log2(n) k = n^2 z = 2^n w = factorial(n) plot(n, f, ylim=c(0,200), t='l', col=3) lines(n, g, t

Counting observations by 30-days window

As I explained in previous posts I'm trying to count observations over 30 days windows grouping by id. The data: df<-structure(list(id=c(1,1,1,2),date=c("200

Can I run the "phylosig()" command in multiple columns and expect one outcome?

In today's episode of total despair we're going to try and define the phylogenetic signal for a bunch of traits. The tricky part is that the data frame consists

Selecting elements from list based on length in R

I have this list of ~270'000 elements with each element having a length of either 165 or 166. What I would like is to isolate into a separate dataset those elem

Counter for occasion within a day based on date/time by ID

Now updated with the code for the data frame - Thanks for the tip! structure(list(id = c(5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L), date = c("2022-03-03"

How can I add geographic distance matrix to an igraph network?

I have an igraph network of 169 nodes (neighbourhoods). I've added some vertices attributes using: V(g)$attribute. I'm going to study the impact of the geogra

Fastshap summary plot - Error: can't combine <double> and <factor<919a3>>

I'm trying to get a summary plot using fastshap explain function as in the code below. p_function_G<- function(object, newdata) caret::predict.train(object

How can I filter rows out if their start date is within 90 days from today and place them out until the 1st of the following month in R?

I am having difficulty finding the words to describe what I am searching for but will try. I would like to solve the following using R or Python (but preferably

Assign variables in groups based on fractions and several conditions

I've tried for several days on something I think should be rather simple, with no luck. Hope someone can help me! I have a data frame called "test" with the fol