Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotTimeProfile() multiple simulation results within one group are connected #340

Closed
IndrajeetPatil opened this issue Jul 19, 2022 · 0 comments · Fixed by #351
Closed

plotTimeProfile() multiple simulation results within one group are connected #340

IndrajeetPatil opened this issue Jul 19, 2022 · 0 comments · Fixed by #351

Comments

@IndrajeetPatil
Copy link
Member

Related to Open-Systems-Pharmacology/OSPSuite-R#982.

library(tlf)

df <- dplyr::tibble(
  xValues = c(0, 1, 2, 3, 4, 0, 1, 2, 3, 4),
  yValues = c(
    0,
    0.00788349099457264, 0.0343151688575745, 0.0759411081671715,
    0.130162701010704, 0, 5.10453501689767e-09, 4.76278302130595e-07,
    6.20401988271624e-06, 3.64091392839327e-05
  ), 
  group = "myGroup", 
  name = c(rep("data1", 5),  rep("data2", 5))
)

df
#> # A tibble: 10 x 4
#>    xValues       yValues group   name 
#>      <dbl>         <dbl> <chr>   <chr>
#>  1       0 0             myGroup data1
#>  2       1 0.00788       myGroup data1
#>  3       2 0.0343        myGroup data1
#>  4       3 0.0759        myGroup data1
#>  5       4 0.130         myGroup data1
#>  6       0 0             myGroup data2
#>  7       1 0.00000000510 myGroup data2
#>  8       2 0.000000476   myGroup data2
#>  9       3 0.00000620    myGroup data2
#> 10       4 0.0000364     myGroup data2

tlf::plotTimeProfile(
  data = as.data.frame(df),
  dataMapping = tlf::TimeProfileDataMapping$new(
    x = "xValues",
    y = "yValues",
    group = "group"
  ),
  plotConfiguration = TimeProfilePlotConfiguration$new()
)

Created on 2022-07-19 by the reprex package (v2.0.1.9000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant