% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sg-gof-tp.R
\name{sg_gof_tp}
\alias{sg_gof_tp}
\title{Plot time profiles of the fitted data}
\usage{
sg_gof_tp(
  fpath_i,
  pop = TRUE,
  filt = "T",
  cov_cols = NULL,
  col_i = NULL,
  DVID = 1,
  tsld = FALSE,
  f_scales = "free",
  sort_by = NULL,
  desc = FALSE,
  log_y = FALSE,
  lab_x = "Time since first dose, h",
  lab_y = "Plasma concentration, mmol/L",
  cap = str_c("empty circles - observed data\\n", "solid lines with point - ",
    "individual predictions\\n", "dashed grey lines with ",
    "point - population predictions"),
  n_quantiles = 3,
  levels_discrete = 10
)
}
\arguments{
\item{fpath_i}{String or sg-fit object. If the string is given, the path to
\code{.Rdata} or \code{.json} file with sg-fit object is expected.}

\item{pop}{Logical. If \code{TRUE} (default), adds population predictions (PRED) as dashed lines and points.}

\item{filt}{String. Provide a filter to apply. Default is \code{"T"}}

\item{cov_cols}{A character vector specifying the names of the columns with covariates.}

\item{col_i}{String. Column name for color}

\item{DVID}{Restrict \code{SDTAB} to one observation type. Numeric values
select the \code{DVID} column (default \code{1}). If \code{SDTAB} has
\code{DVNAME}, a character or factor is matched to \code{DVNAME} first;
otherwise a digit-only string is coerced to numeric \code{DVID}.}

\item{tsld}{Logical. If \code{TRUE}, uses time since last dose instead of time from first dose. Default is \code{FALSE}.}

\item{f_scales}{String, one of \code{"fixed"}, \code{"free"}, \code{"free_x"}, \code{"free_y"}. User can specify whether the scales (x and y axes) should be fixed across all panels (\code{"fixed"}), free for each panel (\code{"free"}), or free only in one dimension (\code{"free_x"} or \code{"free_y"}). Default is \code{"fixed"}}

\item{sort_by}{Character vector of column names to sort ID facets by.
Use "DOSE" to sort by last dose. Other names (e.g. covariates) must exist in SimuRg object.}

\item{desc}{Logical. If TRUE, sort in descending order for all columns in \code{sort_by}.}

\item{log_y}{Logical. If \code{TRUE}, a logarithmic scale is applied to y-axis. Default is \code{FALSE}.}

\item{lab_x}{String. X-ax label. Default is "Time since first dose, h"}

\item{lab_y}{String. Y-ax label. Default is "Plasma concentration, mmol/L"}

\item{cap}{String. Plot caption. Default is "empty circles - observed data solid lines with point - individual predictions dashed grey lines with point - population predictions"}

\item{n_quantiles}{Integer. Number of quantile groups for continuous variables in \code{col_i}. Default is 3.}

\item{levels_discrete}{Integer. Maximum unique values to consider a variable discrete. Default is 10.}
}
\value{
A list of plots with predicted time profiles, faceted by id
}
\description{
Plot time profiles of the fitted data
}
\examples{
\donttest{
fpath_i <- system.file("extdata", "simurg_object", "Warfarin_PK.RData",
                        package = "SimuRg")
plot_list <- sg_gof_tp(fpath_i)
print(plot_list[[1]])
}
}
