How to plot a list ?

Hello
I am newbie to R (sutdio).
I would like to plot the following dataframe, which contains lists for the insid variable:
image

The variable FixedTime is the x axis
I'd want that each id in the insid variable be plotted on th y axis.

How can i do that?
I ve been scratching my head for hours but didt find the solution.

Thanks in advance.

nikk0

are you hoping to summarise the ID information in some way ? like making a histogram to count the volumes of them in each time period ?

the idea of directly plotting ID's seems highly unusual/unlikely...

I think you want to unnest your list first.

library(tidyverse)

dat = tibble(
  x = c("a", "b"),
  y = list(c(1,2,3), c(2,3,4))
)

dat
#> # A tibble: 2 x 2
#>   x     y        
#>   <chr> <list>   
#> 1 a     <dbl [3]>
#> 2 b     <dbl [3]>

dat |> 
  unnest(y) |> 
  ggplot(aes(x = x, y = y)) +
  geom_point()

Created on 2021-12-13 by the reprex package (v2.0.1)

Hello nirgrahamuk.
Agree that this is no summary for the moment but this is a starting point to analyze log files for an internal software that fails sometime and we need to know why.

Regards

Hi Jack.

Thanks a lot. It works well.

Regards.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.