Skip to main content

All Questions

Tagged with
1 vote
2 answers
69 views

parallel/automatic way of unnesting list columns that contains data frames (list columns might be empty)

Please consider the following data frame: df <- structure(list(oID = c(37751L, 30978L, 33498L), peId = c(12L, 13L, 14L), last_Name = c("ABC", &...
deschen's user avatar
  • 10.4k
0 votes
1 answer
45 views

Change raster extent with tidy

I have files from ERA5 that have extent from 0 to 360 (lon) and -90 to 90 (lat) Example: > era5_sr class : SpatRaster dimensions : 721, 1440, 744 (nrow, ncol, nlyr) resolution : 0.25, 0....
herakles_1950's user avatar
1 vote
1 answer
24 views

pivot_longer from multiple columns into a singular names_to and two values_to

I've spent most of the day on this and finally calling in some help. There are multiple entries here on related questions, but none that quite get at what I'm trying to do. Below is an example df. x &...
Scott Davidson's user avatar
3 votes
1 answer
46 views

Is there an R Function that allows you to extract a single digital from a numeric variable REGARDLESS of its location (not just first or last digit?

I have seen a lot of posts regarding how to extract the first number in a numeric variable or the last using functions like gsub or grep, however I want to be able to extract a specific digit ...
EtoiledeMoyenOrient's user avatar
0 votes
1 answer
34 views

Massive dataset - average values by month and location

I would really appreciate some assistance with sorting some data to reduce temporal auto-correlation for a massive dataset that I have (almost 2600 rows). I'm sure this is probably quite an easy thing ...
JDK's user avatar
  • 21
0 votes
0 answers
48 views

Getting DOI for a list of citations in R

I have a list of citations. Here is the data: df<-structure(list(Citation_Text = c("Knopf, M. D. (1996). Analyzing noncompliance in fisheries management: the roles of social influences and ...
David Smith's user avatar
0 votes
1 answer
49 views

How to combine multiple columns of data into 1 column when pivoting wider in R

I have a data set similar in structure to this example one: df <- data.frame(sample=c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'), test_1=c(2, 1, 4, 3, 5, 2, 1, 4), ...
Georble02's user avatar
0 votes
1 answer
33 views

Extract a vector with dplyr while maintaining ID variable for each row [duplicate]

I have a data set: df<-structure(list(spp = list(c("Other species (please list species name; i.e. Tarpon)", "Other species (please list species name; i.e. Amberjack)"), c(&...
David Smith's user avatar
0 votes
3 answers
64 views

stop mutate truncating column column names

I am making a large data frame using mutate with lots of ifelse conditions. My approach is to not name the columns within mutate because I have many hundreds of these conditions and each time I update ...
ThallyHo's user avatar
  • 2,813
0 votes
1 answer
119 views

Converting multiple columns from character to POSIXct in R

I have multiple dataframes with multiple date/time columns that are initially character variables when I import them and I would like to convert the to a POSIXct format. I am open to other date/time ...
EtoiledeMoyenOrient's user avatar
0 votes
2 answers
60 views

how to plot a combined histogram with different datasets in r

I have 2 datasets and I am trying to find a better way of visualizing my results. Can you please help me to plot the 2 histograms on 1 histogram so it is easier to compare? data1: count <- c('10', '...
Nashe's user avatar
  • 45
4 votes
5 answers
179 views

Convert a columns into separate columns in wide format in R

I am trying to convert the "FRUITS" column into separate columns ("Apple" and "Banana") in wide format. Gender AgeGroup EAT FRUITS 1 Female ...
01200's user avatar
  • 97
1 vote
1 answer
27 views

how do i write a function to generalize multiple lmer models with different response variables?

I am trying to generalize a function that will run all these different model combinations but on different response variables. ` model_suite <- function(response, df){ mod1.2 <- lmer(log(...
maslein's user avatar
  • 11
0 votes
1 answer
62 views

How would you create a recursively nested tibble in R

I trying to create what I'm calling a recursively nested tibble, a tibble with x rows that is nested such that each x row nests the following n rows of y. Here is an example of what I'm trying to ...
Mutuelinvestor's user avatar
0 votes
2 answers
44 views

pivot longer by looping over certain columns

I have the following data which belongs to my darts league in wide format structure(list(home_team = c("Art of Dart", "Art of Dart", "Art of Dart", "Art of Dart&...
Emre Toros's user avatar

15 30 50 per page
1
2 3 4 5
43