Running examples in 'protti-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: calculate_protein_abundance
> ### Title: Label-free protein quantification
> ### Aliases: calculate_protein_abundance
> 
> ### ** Examples
> 
> # Create example data
> data <- data.frame(
+   sample = c(
+     rep("S1", 6),
+     rep("S2", 6),
+     rep("S1", 2),
+     rep("S2", 2)
+   ),
+   protein_id = c(
+     rep("P1", 12),
+     rep("P2", 4)
+   ),
+   precursor = c(
+     rep(c("A1", "A2", "B1", "B2", "C1", "D1"), 2),
+     rep(c("E1", "F1"), 2)
+   ),
+   peptide = c(
+     rep(c("A", "A", "B", "B", "C", "D"), 2),
+     rep(c("E", "F"), 2)
+   ),
+   intensity = c(
+     rnorm(n = 6, mean = 15, sd = 2),
+     rnorm(n = 6, mean = 21, sd = 1),
+     rnorm(n = 2, mean = 15, sd = 1),
+     rnorm(n = 2, mean = 15, sd = 2)
+   )
+ )
> 
> data
   sample protein_id precursor peptide intensity
1      S1         P1        A1       A  13.74709
2      S1         P1        A2       A  15.36729
3      S1         P1        B1       B  13.32874
4      S1         P1        B2       B  18.19056
5      S1         P1        C1       C  15.65902
6      S1         P1        D1       D  13.35906
7      S2         P1        A1       A  21.48743
8      S2         P1        A2       A  21.73832
9      S2         P1        B1       B  21.57578
10     S2         P1        B2       B  20.69461
11     S2         P1        C1       C  22.51178
12     S2         P1        D1       D  21.38984
13     S1         P2        E1       E  14.37876
14     S1         P2        F1       F  12.78530
15     S2         P2        E1       E  17.24986
16     S2         P2        F1       F  14.91013
> 
> # Calculate protein abundances
> protein_abundance <- calculate_protein_abundance(
+   data,
+   sample = sample,
+   protein_id = protein_id,
+   precursor = precursor,
+   peptide = peptide,
+   intensity_log2 = intensity,
+   method = "iq",
+   for_plot = FALSE
+ )
Error: Package "iq" is needed for this function to work. Please install it.
Execution halted