Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
0 answers
43 views

Suppose I have df <- data.frame(name=c("Hello", "Hi", "GoodMorning")) I would like to convert "GoodMorning" into "GoodEvening" (of course this is ...
robertspierre's user avatar
1 vote
4 answers
181 views

I have the following tibble: eu_df <- structure( list( nuts_code = c( "PT17", "PT17", "PT17", "PT17", "PT17", "PT17", "PT17", &...
robertspierre's user avatar
3 votes
7 answers
328 views

Suppose I have a list of dataframes l. All dataframes are guaranteed to have the same shape and contain the same columns. I would like to combine the columns of those dataframes with a column-specific ...
robertspierre's user avatar
4 votes
4 answers
296 views

When printing a tibble, how do I print the cells with nested data types (in list columns)? Let's have a look at two examples: 1. call data type b <- tibble(a = 1, prior = list(call("rnorm"...
Tomas's user avatar
  • 60.2k
2 votes
2 answers
118 views

I am trying to deduct values across a data frame of elements. structure(list(Date = structure(c(20095, 20095, 20095, 20095, 20123, 20123, 20123, 20123), class = "Date"), Type = c("Drip&...
B.Shermeister's user avatar
0 votes
1 answer
114 views

In dplyr filter, how to parse conditions which are stored in string?When there's only one condition, below code can work library(dplyr) conditions_string_1 <- "Species=='versicolor'" iris ...
anderwyang's user avatar
  • 2,547
0 votes
2 answers
83 views

Sometimes, in case report forms the almost-same entries are inserted on a certain day and for some patient. I want to find similar, possibly misspelled comment, per patient and date. Finding the ...
Dieter Menne's user avatar
  • 10.3k
9 votes
6 answers
358 views

For fun, I would like to track the time when a baby is sleeping or feeding over the course of 24 hours and then visualize this as a pi chart or polar chart so that it resembles a 24-hour clock. Every ...
user3710004's user avatar
3 votes
4 answers
178 views

I have a data frame of names, and each name has a count of individuals, e.g. df = read.table(header=TRUE, text= 'name count a 10 b 1 c 7 d 3') > df name count 1 a 10 2 b ...
user72959's user avatar
  • 119
0 votes
1 answer
101 views

I have a recurring problem which I have been addressing using a messy approach of multiple passes of pivot_wider and rbinding the results together. This seems inelegant, does anyone have a single ...
Peter's user avatar
  • 152
2 votes
3 answers
108 views

I started with a simple example which works, but I don't know how to use within dplyr mutate This works, I get "bcd-234": library(tidyverse) list = c("abc-123", 'bcd-234', 'cde-345'...
Shreko's user avatar
  • 363
1 vote
2 answers
132 views

After reading in my data using read_csv() from readr, the command spec() returns "full column specification" for the resulting tibble: > spec(steps) cols( duration = col_double(), ...
Ben's user avatar
  • 821
3 votes
2 answers
132 views

I am trying to write a function that, using tidyverse tools, will load two CSVs, join them on some key column, and write the joined result to a CSV. I am passing in the names of the key columns as ...
Lee Hachadoorian's user avatar
1 vote
2 answers
100 views

I have two data.frames, nests, and nest_days, which contains more days for one nest. I want to do a join, and group by nests (i.e. group by the rows of the first data.frame). I want to keep all ...
Tomas's user avatar
  • 60.2k
8 votes
4 answers
714 views

I have two data frames I am working with. The first contains information on a cohort of kids. These same kids have been measured multiple times on different days (uniqueID AD_1 indicates child AD ...
Taylor Harman's user avatar
1 vote
1 answer
35 views

I want to visualize the distribution of a variable ('F3A7_1') by plotting a histogram, and right underneath it a boxplot (below the y-axis of the histogram or something). I also want to create this ...
kornpat's user avatar
  • 37
2 votes
3 answers
88 views

Unexpected output of set_names() I'm trying to name a list of tibbles using set_names. I expect the names to be "tbl_df, tbl, data.frame" However, the result is "character". Any ...
Rasmus Larsen's user avatar
2 votes
1 answer
71 views

I have this dataframe: mydf <- structure(list(Time = c("T0", "T3", "T3", "T0", "T3", "T3"), Organism = c("BB", "BB&...
aminards's user avatar
  • 459
1 vote
2 answers
58 views

I am trying to do a bar plot, however, is printing multiple lines on each bar. I understand that I might have to aggregate but if I do I need to retain the original columns because I need to fill by ...
Salvador's user avatar
  • 1,973
2 votes
2 answers
277 views

I'm working with 50 Parquet files (each file is of ~800MB with ~380000 rows and ~8 columns). I need to perform a grouped summarisation in R. Something like: group_by(sample_id, gene1, gene2) %>% ...
Arindam Ghosh's user avatar
1 vote
3 answers
85 views

I am using survey data and would like to create multiple cross tables with row percentages at once. Below is some dummy data and the way I would create those tables individually. Where I get confused ...
C More's user avatar
  • 31
4 votes
5 answers
164 views

I'm relatively new to R. I have a table of data consisting of an id, plus 3 values. library(dplyr) df <- tibble(id=c(1, 2, 3),val_a = c(13,25,42), val_b = c(25,30,0), val_c = c(7,27,21)) df # A ...
Buckaroo Banzai's user avatar
2 votes
1 answer
124 views

With {gt}, you can conditionally style cells based on the values in another column in your dataframe. Is there a way to conditionally overwrite the cell display values based on a different column? In ...
Mark Rieke's user avatar
2 votes
2 answers
97 views

I am using mark-recapture data, with each individual having a PIT tag (Tag) and a genetic sample ID given at the first observation (ID), which is typically used as the ID for the individual (Unified....
ghaines's user avatar
  • 93
1 vote
1 answer
49 views

I'd like to know if there is a way to parse a dynamic case_when expression. Let's take as an example a vector of of 3 thresholds : thresholds = c(0.4, 0.6, 0.8) Based on that, I would like to assign ...
Rgrvkfer's user avatar
  • 417

1
2 3 4 5
206