library(pacman)

p_load(
  vroom,
  dplyr,
  tidyr,
  ggplot2)
# 1) Cargar datos
qPCR <- vroom::vroom("Datos Curva G1 y G2.csv")
## Rows: 51 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (9): Cycle, 50 ng, 10 ng, 5 ng, 1 ng, 0.5 ng, 0.1 ng, G1-M, G2-M
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# 2) Pasar de ancho a largo

Datos_largo <- qPCR %>%
  pivot_longer(
    cols = -Cycle,
    names_to = "Replica",
    values_to = "Fluorescencia"
  )
# 3) Filtrar solo 0.5 ng
Datos_05 <- Datos_largo %>%
  filter(Replica == "0.5 ng")
# 4) Graficar
Grafica_amplificacion <- ggplot(
  Datos_05,
  aes(x = Cycle, y = Fluorescencia, color = Replica, group = Replica)
) +
  geom_line(size = 1) +
  labs(
    title = "qPCR Práctica No. 4",
    subtitle = "0.5 ng",
    x = "Ciclo",
    y = "Fluorescencia",
    caption = "Integrantes: DLS"
  ) +
  theme_minimal(base_size = 14) +
  theme(
    plot.title = element_text(face = "bold"),
    plot.subtitle = element_text(color = "gray30"),
    legend.title = element_blank()
  )
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Grafica_amplificacion