yutannihilation / gghighlight

Highlight points and lines in ggplot2

Home Page:https://yutannihilation.github.io/gghighlight/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gghighlight() cannot handle data containing column `x`

rbratslaver opened this issue · comments

Hi - I was hoping you could help me understand why the highlighted line is being moved away from the rest of the data. Thank you.

df <- tibble::tibble(
  week = c(1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 
           4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 
           8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 
           12, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 
           16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17),
  team_name = c("Broncos", "Cardinals", "Falcons", "Lions", "Panthers", "Raiders", 
                "Steelers", "Bills", "Dolphins", "Patriots", "Texans", "Bears", 
                "Bills", "Chargers", "Giants", "Jaguars", "Lions", "Titans", 
                "Bills", "Chiefs", "Cowboys", "Dolphins", "Giants", "Lions", 
                "Packers", "Patriots", "Seahawks", "Bills", "Patriots", "Redskins", 
                "Dolphins", "Jets", "Rams", "Bengals", "Eagles", "Jaguars", "Patriots", 
                "Ravens", "Saints", "Seahawks", "49ers", "Chiefs", "Cowboys", 
                "Raiders", "Vikings", "Buccaneers", "Packers", "Raiders", "Titans", 
                "Colts", "Dolphins", "Colts", "Eagles", "Jaguars", "Jets", "Raiders", 
                "Seahawks", "Titans", "Vikings", "Bears", "Browns", "Chargers", 
                "Packers", "Patriots", "Texans", "Broncos", "Browns", "Patriots", 
                "Browns", "Colts", "Lions", "Panthers", "Saints", "Browns", "Cardinals", 
                "Colts", "Dolphins", "Eagles", "Jets", "Panthers", "Saints", 
                "Steelers", "Bills", "Browns", "Giants", "Jaguars", "Texans"),
  x = c(76843, 65538, 66410.5, 59523, 62442, 69143, 60147, 74122, 66227, 
        51557, 88240, 66944, 68174, 77604, 68161, 70893.5, 62472, 62370, 
        71756, 69238, 61535, 73344, 78213, NaN, 63329, 66113, NaN, 71575, 
        72220, NaN, 66437, 78161, 57307, 54328, 65523, 66534, 65878, 
        NaN, 67903, 63593, 83941, 78037, 62068, 52950, 60422, 65589, 
        66944, 60827.5, 72540, 70020, 73132, 66751, 69144, 54871.5, 78843, 
        60202, 67616, 68801, 66883, 62148, 51710, 71897, 78488, 78025, 
        71812, 61990, 68576, 74012.5, 60028, 55603, 77922, 72842, 61758.5, 
        68798, 72025, 63663.5, 68756, 69596, 78160, 73860, 92570, 60865, 
        61563.5, 65362, 79110, 71023, 71777)
)
df %>% 
ggplot(aes(week,x,color=team_name))+
  geom_point()+
  geom_line()+
  gghighlight(team_name=='Patriots')+
  theme(legend.position = 'none')

image

Hmm, thanks for reporting. It seems there happens some collisions between the aesthetic x and the column name x... Here's a minimal reprex:

library(gghighlight)
#> Loading required package: ggplot2

set.seed(22)
df <- tibble::tibble(
  week = rep(1:3, each = 3),
  values = runif(9),
  x = values,
  id = rep(c("a", "b", "c"), times = 3)
)

# works
ggplot(df, aes(week, values, colour = id)) +
  geom_line() +
  gghighlight(id == "a")
#> Warning: Tried to calculate with group_by(), but the calculation failed.
#> Falling back to ungrouped filter operation...
#> label_key: id

# won't work
ggplot(df, aes(week, x, colour = id)) +
  geom_line() +
  gghighlight(id == "a")
#> Warning: Tried to calculate with group_by(), but the calculation failed.
#> Falling back to ungrouped filter operation...
#> label_key: id

Created on 2020-04-04 by the reprex package (v0.3.0)

So, an workaround is to rename x to some other name.

I think this might be a more general problem if column names are synonimous with ggplot2-aesthetics? Here's an example for a column named group:

rats <- structure(list(subject = c(8L, 8L, 10L, 10L, 10L, 10L, 10L, 10L,   10L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 16L, 16L, 16L, 16L, 16L,   16L, 16L, 17L, 17L, 17L, 17L, 17L, 27L, 27L, 27L, 27L, 27L, 27L,   27L, 28L, 30L, 30L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 32L, 32L,   32L, 32L, 33L, 33L, 33L, 33L, 33L, 33L, 34L, 34L, 34L, 34L, 34L,   34L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 37L, 37L, 37L, 37L, 37L,   37L, 37L, 38L, 38L, 38L, 38L, 39L, 39L, 39L, 39L, 40L, 40L, 40L,   40L, 40L, 41L, 41L, 41L, 41L, 41L, 41L, 41L, 1L, 1L, 1L, 1L,   1L, 1L, 1L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 12L, 12L, 12L, 12L, 14L,   14L, 14L, 49L, 49L, 49L, 49L, 49L, 49L, 49L, 50L, 50L, 50L, 50L,   50L, 50L, 50L, 51L, 51L, 51L, 51L, 52L, 52L, 52L, 52L, 52L, 52L,   52L, 53L, 53L, 53L, 53L, 53L, 53L, 53L, 54L, 54L, 54L, 56L, 56L,   56L, 56L, 57L, 57L, 57L, 57L, 57L, 57L, 57L, 59L, 60L, 60L, 60L,   60L, 60L, 60L, 60L, 62L, 62L, 63L, 63L, 63L, 63L, 63L, 63L, 63L,   64L, 64L, 64L, 64L, 64L, 64L, 64L, 3L, 3L, 3L, 3L, 5L, 6L, 6L, 
  6L, 9L, 9L, 9L, 9L, 9L, 11L, 11L, 11L, 20L, 20L, 20L, 20L, 22L,   22L, 22L, 22L, 22L, 22L, 22L, 23L, 24L, 24L, 24L, 24L, 24L, 24L,   24L, 25L, 25L, 25L, 26L, 26L, 26L, 26L, 43L, 43L, 43L, 43L, 43L,   44L, 44L, 44L, 44L, 44L, 44L, 44L, 47L, 47L, 47L, 47L, 47L, 48L, 
  48L, 48L, 48L, 48L, 48L, 48L), group = structure(c(1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,     2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,     3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("low dose", "high dose", 
      "control"), class = "factor"), response = c(71.7008, 78.8162,         71.2811, 78.492, 82.4924, 82.3772, 84.8116, 84.2912, 83.863,         66.6033, 70.6045, 72.0694, 73.8783, 75.8222, 78.2432, 79.6492,         72.7186, 81.5659, 82.134, 83.006, 83.7377, 84.8999, 86.8332,         73.2462, 80.9568, 78.4092, 81.2712, 83.4086, 70.4557, 78.4092,       79.404, 80.8022, 82.662, 82.8794, 85.703, 70.1783, 72.2496, 75.4321,         70.8308, 75.8024, 80, 81.6333, 82.0061, 80.8084, 82.6801, 70.1783,         72.4707, 75.8222, 76.6094, 69.1158, 74.3303, 76.8505, 77.0065,         78.5175, 81.6884, 73.0068, 77.5242, 77.201, 82.801, 81.3204,         83.4086, 75.0733, 78.032, 80.1561, 83.006, 82.2192, 84.0536, 
        84.864, 69.7711, 74.4043, 76.6094, 77.3886, 82.4197, 80.2808,         82.662, 71.5612, 78.0064, 81.6884, 79.3221, 74.027, 75.4718,         79.511, 80.4487, 70.3449, 76.844, 76.6942, 81.0247, 81.3449,         73.2462, 78.2368, 79.6492, 80.2122, 84.8116, 82.3286, 85.2115,         69.3397, 73.2462, 77.3886, 78.1025, 76.4853, 77.801, 79.0569, 
        70.825, 75, 76.844, 81.0247, 80.604, 82.801, 83.8153, 74.2765,         77.7817, 79.9062, 84.6463, 71.1196, 74.4043, 75.452, 69.4622,         74.686, 75.743, 78.2432, 77.1557, 77.4661, 80.2808, 73.2462,         74.6525, 76.844, 80.2808, 80.604, 82.3772, 83.4086, 68.884, 72.9178,         76.0592, 79.2023, 71.4213, 76.844, 77.666, 81.8352, 81.4002,         83.4086, 84.7231, 70.4557, 72.1249, 75.452, 78.6003, 77.3369, 
        79.8812, 80.8022, 67.6018, 70.6612, 74.2024, 69.3109, 73.9256,         75.4718, 77.7817, 72.2011, 76.0066, 77.0779, 80.1561, 81.3941,         83.4865, 82.662, 70.8378, 70.214, 75.4321, 77.4209, 79.0569,         77.2334, 81.0247, 83.5284, 71.7008, 74.8131, 68.4763, 75.4718,         76.4003, 78.2304, 78.5493, 80.2808, 81.3941, 70.8025, 73.4098, 
        75.6042, 78.6448, 79.0253, 80.604, 81.8841, 75.0067, 78.5684,         79.925, 80.7775, 67.9559, 76.0066, 78.2943, 81.2158, 70.8308,         74.9533, 75.1665, 77.666, 82.7345, 71.8471, 75.1332, 76.2168,         72.8354, 78.5684, 80.604, 82.0731, 70.7248, 74.8131, 75.1665,         77.0065, 81.0247, 78.492, 81.8413, 74.5185, 73.4983, 75.591, 
        77.9359, 79.196, 81.0247, 82.4621, 86.2844, 69.6419, 74.0945,         78.3901, 74.027, 77.5242, 81.8352, 81.6333, 70.2922, 76.0263,         77.8332, 79.511, 80.2808, 70.8025, 75.2861, 78.3901, 80.9197,         79.6053, 80.6226, 82.662, 66.8431, 73, 74.6525, 77.4661, 77.1038,         70.6045, 74.9533, 78.4092, 78.6003, 80.7217, 82.801, 83.006), 
  time = c(50L, 60L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L,     60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L, 70L, 80L, 90L,     100L, 110L, 50L, 60L, 70L, 80L, 90L, 50L, 60L, 70L, 80L, 
    90L, 100L, 110L, 50L, 50L, 60L, 50L, 60L, 70L, 80L, 90L,     100L, 110L, 50L, 60L, 70L, 80L, 50L, 60L, 70L, 80L, 90L,     100L, 50L, 60L, 70L, 80L, 90L, 100L, 50L, 60L, 70L, 80L, 
    90L, 100L, 110L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L,     60L, 70L, 80L, 50L, 60L, 70L, 80L, 50L, 60L, 70L, 80L, 90L,     50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L, 70L, 80L,     90L, 100L, 110L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 
    60L, 70L, 80L, 50L, 60L, 70L, 50L, 60L, 70L, 80L, 90L, 100L,     110L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L, 70L,     80L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L, 70L,     80L, 90L, 100L, 110L, 50L, 60L, 70L, 50L, 60L, 70L, 80L,     50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 50L, 60L, 70L,     80L, 90L, 100L, 110L, 50L, 60L, 50L, 60L, 70L, 80L, 90L,     100L, 110L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L,     70L, 80L, 50L, 50L, 60L, 70L, 50L, 60L, 70L, 80L, 90L, 50L,     60L, 70L, 50L, 60L, 70L, 80L, 50L, 60L, 70L, 80L, 90L, 100L,     110L, 50L, 50L, 60L, 70L, 80L, 90L, 100L, 110L, 50L, 60L, 
    70L, 50L, 60L, 70L, 80L, 50L, 60L, 70L, 80L, 90L, 50L, 60L,     70L, 80L, 90L, 100L, 110L, 50L, 60L, 70L, 80L, 90L, 50L,     60L, 70L, 80L, 90L, 100L, 110L), log_time = c(0.405465108108164,       0.916290731874155, 0.405465108108164, 0.916290731874155,       1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159,       2.01490302054226, 0.405465108108164, 0.916290731874155, 1.25276296849537,       1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226,       0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627,       1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164,       0.916290731874155, 1.25276296849537, 1.50407739677627, 1.70474809223843,       0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627,       1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164,        0.405465108108164, 0.916290731874155, 0.405465108108164, 
      0.916290731874155, 1.25276296849537, 1.50407739677627, 1.70474809223843, 
      1.87180217690159, 2.01490302054226, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 1.87180217690159, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159, 
      2.01490302054226, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164, 
      0.916290731874155, 1.25276296849537, 1.50407739677627, 1.70474809223843, 
      1.87180217690159, 2.01490302054226, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164, 
      0.916290731874155, 1.25276296849537, 1.50407739677627, 0.405465108108164, 
      0.916290731874155, 1.25276296849537, 1.50407739677627, 1.70474809223843, 
      1.87180217690159, 2.01490302054226, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159, 
      2.01490302054226, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 1.87180217690159, 2.01490302054226, 0.405465108108164, 
      0.916290731874155, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159, 
      2.01490302054226, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      0.405465108108164, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.405465108108164, 0.916290731874155, 
      1.25276296849537, 1.50407739677627, 1.70474809223843, 1.87180217690159, 
      2.01490302054226, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226, 
      0.405465108108164, 0.916290731874155, 1.25276296849537, 1.50407739677627, 
      1.70474809223843, 0.405465108108164, 0.916290731874155, 1.25276296849537, 
      1.50407739677627, 1.70474809223843, 1.87180217690159, 2.01490302054226
    ), fitted_logtime = structure(c(73.0563923887434, 76.8911060161097, 
      73.6449866461212, 77.4797002734875, 80.0055615673854, 81.8921522512623, 
      83.3985658192205, 84.6526230652965, 85.7268658786286, 66.7933308005358, 
      70.6280444279021, 73.1539057218, 75.0404964056769, 76.5469099736351, 
      77.8009672197111, 78.8752100330432, 74.628987832907, 78.4637014602732, 
      80.9895627541711, 82.8761534380481, 84.3825670060063, 85.6366242520823, 
      86.7108670654144, 73.6566398805419, 77.4913535079081, 80.017214801806, 
      81.903805485683, 83.4102190536411, 72.6601482183849, 76.4948618457512, 
      79.0207231396491, 80.9073138235261, 82.4137273914842, 83.6677846375602, 
      84.7420274508923, 70.603070114292, 71.8776085626013, 75.7123221899676, 
      71.775049494848, 75.6097631222143, 78.1356244161122, 80.0222150999891, 
      81.5286286679473, 82.7826859140233, 83.8569287273554, 69.3887614180145, 
      73.2234750453807, 75.7493363392786, 77.6359270231556, 69.8398991586, 
      73.6746127859662, 76.2004740798642, 78.0870647637411, 79.5934783316993, 
      80.8475355777753, 72.6115207170072, 76.4462343443735, 78.9720956382714, 
      80.8586863221483, 82.3650998901065, 83.6191571361825, 73.6190726883147, 
      77.453786315681, 79.9796476095789, 81.8662382934558, 83.372651861414, 
      84.62670910749, 85.7009519208221, 70.3942501130725, 74.2289637404388, 
      76.7548250343367, 78.6414157182136, 80.1478292861718, 81.4018865322478, 
      82.4761293455799, 72.9067024804256, 76.7414161077919, 79.2672774016898, 
      81.1538680855668, 72.6525526618436, 76.4872662892098, 79.0131275831077, 
      80.8997182669847, 71.6143203443917, 75.4490339717579, 77.9748952656558, 
      79.8614859495328, 81.3678995174909, 73.1166605985858, 76.9513742259521, 
      79.47723551985, 81.3638262037269, 82.8702397716851, 84.1242970177611, 
      85.1985398310932, 69.3305873357817, 72.8405327859441, 75.1524747502642, 
      76.8792869794581, 78.2581199152957, 79.4059689994347, 80.3892324296205, 
      71.9599695485859, 75.4699149987483, 77.7818569630684, 79.5086691922623, 
      80.8875021280999, 82.0353512122389, 83.0186146424248, 74.6069476232243, 
      78.1168930733867, 80.4288350377068, 82.1556472669007, 70.6486328694571, 
      74.1585783196195, 76.4705202839396, 69.5489181694529, 73.0588636196153, 
      75.3708055839354, 77.0976178131293, 78.4764507489669, 79.6242998331059, 
      80.6075632632917, 72.0304328272905, 75.5403782774529, 77.8523202417731, 
      79.579132470967, 80.9579654068045, 82.1058144909435, 83.0890779211294, 
      70.1696770232323, 73.6796224733947, 75.9915644377148, 77.7183766669087, 
      72.8251500398328, 76.3350954899952, 78.6470374543153, 80.3738496835092, 
      81.7526826193468, 82.9005317034858, 83.8837951336716, 69.7671679798063, 
      73.2771134299687, 75.5890553942888, 77.3158676234827, 78.6947005593203, 
      79.8425496434593, 80.8258130736451, 68.1494225422965, 71.659367992459, 
      73.9713099567791, 70.0395376064825, 73.5494830566449, 75.861425020965, 
      77.5882372501589, 72.2425788810371, 75.7525243311995, 78.0644662955196, 
      79.7912785247135, 81.1701114605511, 82.3179605446901, 83.3012239748759, 
      70.9980295259267, 71.0172497422141, 74.5271951923765, 76.8391371566966, 
      78.5659493858905, 79.9447823217281, 81.0926314058671, 82.075894836053, 
      71.4836807392367, 74.9936261893992, 70.3275522534139, 73.8374977035763, 
      76.1494396678964, 77.8762518970903, 79.2550848329278, 80.4029339170668, 
      81.3861973472527, 70.4857772891712, 73.9957227393336, 76.3076647036537, 
      78.0344769328477, 79.4133098686852, 80.5611589528242, 81.5444223830101, 
      73.8469456135983, 77.5830487492395, 80.0439569727325, 81.8820335684404, 
      68.9990278062201, 74.7635038941569, 78.4996070297981, 80.9605152532911, 
      70.8357745790467, 74.5718777146879, 77.0327859381809, 78.8708625338888, 
      80.3385383505798, 71.145705698224, 74.8818088338652, 77.3427170573582, 
      73.802294604921, 77.5383977405622, 79.9993059640552, 81.8373825597631, 
      69.9648396885596, 73.7009428242008, 76.1618510476939, 77.9999276434017, 
      79.4676034600927, 80.6894123523922, 81.7360307790429, 73.669001368521, 
      72.2501698862554, 75.9862730218965, 78.4471812453896, 80.2852578410975, 
      81.7529336577884, 82.9747425500879, 84.0213609767386, 70.8313111766027, 
      74.5674143122438, 77.0283225357369, 74.0154027236106, 77.7515058592518, 
      80.2124140827448, 82.0504906784527, 71.3153800943888, 75.0514832300299, 
      77.512391453523, 79.3504680492309, 80.8181438659219, 71.2098169819467, 
      74.9459201175879, 77.4068283410809, 79.2449049367888, 80.7125807534798, 
      81.9343896457793, 82.9810080724299, 68.5628840068794, 72.2989871425205, 
      74.7598953660136, 76.5979719617215, 78.0656477784125, 71.3188878715782, 
      75.0549910072194, 77.5158992307124, 79.3539758264203, 80.8216516431113, 
      82.0434605354108, 83.0900789620615), label = "Fitted values"), 
  resid_logtime = structure(c(0.0496280710622869, 3.33031444369603, 
    -0.370071928937719, 3.00611444369603, 4.48065314979813, 2.47886246592117, 
    3.40684889796302, 1.632391651887, 0.12994883855491, -5.04787192893771, 
    -4.88138555630397, -5.94234685020187, -6.02003753407884, 
    -5.58255110203699, -4.415608348113, -4.0838511614451, 1.06742807106228, 
    6.08001444369603, 4.12225314979813, 3.10766246592117, 2.33294889796302, 
    2.241091651887, 3.10014883855492, 1.59502807106229, 5.47091444369603, 
    0.397453149798125, 1.37286246592116, 2.00384889796302, -1.19547192893772, 
    2.92331444369603, 1.39225314979812, 0.903862465921165, 1.25724889796302, 
    0.220591651887005, 1.96994883855491, -1.47287192893772, 0.598428071062287, 
    -0.0537855563039642, -0.820371928937718, 0.316514443696036, 
    1.98825314979813, 1.73496246592117, 0.601348897963021, -1.85040834811299, 
    -1.05295116144509, -1.47287192893772, -3.01518555630398, 
    -2.18954685020188, -3.28893753407884, -2.53537192893772, 
    -1.15558555630398, -1.16124685020188, -2.89183753407883, 
    -2.88725110203698, -0.970408348112997, 1.35562807106228, 
    2.03831444369602, -0.81074685020188, 2.90266246592117, -0.084351102036976, 
    0.749791651887008, 3.42212807106229, 2.54611444369603, 2.14435314979812, 
    3.10766246592117, 0.814448897963018, 1.394791651887, 1.14334883855491, 
    -1.88007192893771, -1.08158555630396, -1.40234685020188, 
    -2.50973753407884, 1.01494889796302, -2.378008348113, -1.07105116144508, 
    -0.0899719289377146, 2.52051444369603, 3.67665314979813, 
    -0.576237534078828, 2.37582807106229, -0.0140855563039679, 
    1.49925314979812, 0.550362465921168, -1.30627192893772, 1.35811444369602, 
    -1.31754685020188, 1.12636246592116, -0.059851102036987, 
    1.59502807106229, 2.75091444369603, 1.63745314979812, 0.313862465921162, 
    3.40684889796302, -0.330208348113004, 1.47844883855491, -2.05368892441801, 
    -1.65713437458041, 0.173323661099474, -0.839588568094442, 
    -3.83562150393199, -3.66777058807098, -3.39513401825685, 
    -0.59088892441801, 0.0966656254195897, -0.371276338900529, 
    2.08261143190555, 0.283078496068015, 1.33222941192902, 1.36326598174314, 
    2.88311107558199, 2.87836562541959, 2.69092366109948, 5.70421143190555, 
    -0.273788924418, -0.499034374580404, -1.76327633890052, -1.93118892441801, 
    -0.217334374580403, -1.47227633890053, -0.698888568094446, 
    -3.16522150393199, -4.00267058807098, -2.17123401825685, 
    1.852811075582, -0.250834374580407, -0.371276338900529, 1.33871143190555, 
    0.283078496068015, 0.908429411929021, 0.956565981743154, 
    -2.509388924418, -1.98553437458041, -1.15607633890052, 0.260211431905546, 
    0.0279110755819971, 1.94066562541958, 0.450723661099474, 
    2.89311143190555, 1.07927849606801, 1.93982941192903, 2.27106598174315, 
    -0.937688924418012, -2.77843437458041, -1.76327633890052, 
    -0.341788568094444, -2.98402150393198, -1.58757058807097, 
    -1.64983401825685, -3.79158892441801, -4.24213437458042, 
    -3.01287633890053, -2.082488924418, -0.977734374580407, -1.74347633890052, 
    -1.16038856809445, 0.807711075581992, 1.1032656254196, -0.137376338900523, 
    1.21401143190555, 1.07317849606801, 2.01772941192903, 0.209965981743153, 
    -0.555588924418004, -1.17938892441801, 0.528765625419595, 
    0.20562366109948, 0.114811431905551, -3.08752150393198, -0.444070588070986, 
    1.07636598174315, 0.307411075581996, -0.0902343745804046, 
    -2.91708892441801, 0.568465625419591, -0.814976338900522, 
    -0.711688568094445, -1.77162150393198, -1.18797058807098, 
    -1.05793401825686, -0.59088892441801, -1.49353437458041, 
    -1.61107633890052, -0.297288568094444, -1.29562150393198, 
    -0.864770588070982, -0.56793401825685, 3.43379962172013, 
    3.25939648607898, 2.15508826258592, 1.16951166687804, -3.61700037827987, 
    4.43369962172014, 2.98529648607899, 3.44588826258592, -0.742100378279872, 
    -0.355703513921014, -2.60341173741408, -1.94198833312197, 
    1.65883585018705, 0.274199621720129, -0.175803513921011, 
    -1.55311173741407, 1.26249962172014, 3.25939648607898, 2.83408826258592, 
    2.46511166687803, -0.848100378279867, -0.495903513921007, 
    -2.60341173741408, -2.60148833312196, -0.0509641498129554, 
    -3.80547304211242, -1.50279146876309, 2.94559962172013, 1.92539962172013, 
    0.281996486078981, 0.165988262585927, -0.411988333121968, 
    -0.0509641498129554, 0.164626957887577, 2.94030853123691, 
    -1.93100037827986, -1.21450351392102, 0.620188262585927, 
    2.45409962172013, 2.21519648607898, 4.06528826258592, 2.02531166687804, 
    -1.28070037827987, 0.717296486078993, 0.0632882625859281, 
    -0.0969883331219705, -0.794864149812952, -0.770400378279874, 
    -0.0229035139210083, 0.620188262585927, 1.31171166687804, 
    -1.47036414981295, -1.67487304211242, -0.68209146876309, 
    -4.72980037827986, -2.30900351392101, -3.11741173741407, 
    -2.14188833312197, -3.97186414981294, -0.968400378279867, 
    -0.355703513921014, 0.639288262585922, -1.00768833312196, 
    -0.353964149812953, 0.503526957887573, -0.338091468763096
  ), label = "Residuals"), resid_logtime_normalized = c(0.0221728414348644, 
    2.09533311719291, -0.165340824742752, 2.07909206871056, 2.36661371558059, 
    0.284507311966375, 0.922796522911813, -0.590855880755339, 
    -1.66730799289113, -2.25528942528038, -0.819882065014622, 
    -1.26852268774958, -0.994160890330393, -0.460504759426547, 
    0.509942442550958, 0.692367231527458, 0.47690576837214, 3.38333021632862, 
    0.804566389748187, -0.147621818293357, -0.699030027392143, 
    -0.649916118341414, 0.109432058372415, 0.71262702230426, 
    2.75724678492101, -1.77614798458566, -0.598956211638498, 
    -0.00149204900895298, -0.534113233756341, 2.39994718881126, 
    0.471194080703099, -0.009063505065139, 0.258222033449536, 
    -0.578126187286627, 0.859631173276849, -0.658050071968565, 
    0.26736583642718, -0.305002685440249, -0.366525966224238, 
    0.572509129302236, 1.53667048359287, 0.950201172242522, -0.0972231469061873, 
    -1.95440114846677, -1.05272378548359, -0.658050071968565, 
    -1.25089441055843, -0.226280528879197, -0.971360114122401, 
    -1.13275407557522, 0.41245052877116, 0.260999247753139, -1.07299655609956, 
    -0.848213903480662, 0.761527232210993, 0.605667833162202, 
    0.682744236957473, -1.55348959610146, 1.56830042045478, -0.998648024927104, 
    -0.19069066177767, 1.52893919641224, 0.0705315556658078, 
    -0.235604929017188, 0.530527192249828, -1.30126080168423, 
    -0.635619337422122, -0.737597068492935, -0.839978985162566, 
    0.162972761322127, -0.119585056780786, -0.898372634927499, 
    1.93420983922767, -0.989029412375393, 0.166269274689757, 
    -0.0401976798860678, 1.64354222719343, 1.86418957827414, 
    -1.73332646535911, 1.06147303267233, -1.08406322648368, 0.361736246637155, 
    -0.426779953578612, -0.583616484203039, 1.4547549769821, 
    -0.93630844455492, 1.09576107626112, -0.0211953491886126, 
    0.71262702230426, 1.02756302786311, -0.118434816007567, -1.05566380120722, 
    1.48513028834286, -1.62443706871204, 0.0115934271104139, 
    -0.917547627843657, -0.124461404692005, 1.1999152163502, 
    0.145736019157521, -2.13453967748347, -1.64191681897333, 
    -1.19182851865332, -0.263997494689941, 0.328859082137882, 
    -0.115929661453611, 1.70925203251893, 0.00510231472863185, 
    0.80605244513132, 0.712669232124048, 1.28811705451433, 0.525729585180991, 
    0.206667245414892, 2.35680178747315, -0.122323481001775, 
    -0.193447979399436, -1.00823754095914, -0.8628170486043, 
    0.735692832767222, -0.404856109958597, 0.266545025096224, 
    -1.64081244263428, -2.00077086165246, -0.292303757966951, 
    0.827799374593445, -0.997940072228689, -0.725289221409216, 
    0.714854470925951, -0.225454017622099, 0.290957292612697, 
    0.285826207837503, -1.12114538261406, -0.127082624189316, 
    0.498325150611888, 1.4041753462558, 0.0124701170105808, 1.22146450649156, 
    -0.257110684051234, 1.59651916055028, -0.095116216348254, 
    0.578801186285116, 0.75079421118609, -0.418940881467156, 
    -1.3425214054189, -0.152628346790009, 0.926978071924638, 
    -1.24872586103012, 0.0316649452812557, -0.0211229074348692, 
    -1.69400700466061, -0.981865072877254, 0.228757012099963, 
    -0.930414898717884, 0.320610518043403, -0.329452369797522, 
    0.183065807840506, 0.360869347139965, 0.336076950780333, 
    -0.651570154209826, 0.507026131880133, 0.296662094594779, 
    0.967904999553359, -0.571813269816671, -0.24822615226423, 
    -0.526927665158193, 0.869944260309397, 0.332907900325384, 
    0.1795661526486, -2.26263258633649, 0.143849151421787, 1.299328185216, 
    0.13734519372405, -0.196490408434118, -1.30329768592741, 
    1.68153132268045, 0.112901163388632, 0.158975240618412, -0.669895943723471, 
    -0.109492981332767, 0.00706926192579688, -0.263997494689941, 
    -0.682370002595015, -0.520539733543055, 0.576343987209224, 
    -0.292356548896636, 0.0868262550757982, 0.30385620140768, 
    1.53415381460101, 0.518835391194395, -0.438840873624109, 
    -1.04517448531861, -1.61600429234471, 1.98088937526577, -0.107941600221595, 
    0.252707451510548, -0.331555784138797, 0.109617572312863, 
    -1.50119512253511, -0.625456095299126, 2.20801344298072, 
    0.122506972440449, -0.235876153408649, -1.11455006162854, 
    0.564059882336417, 1.50138870156788, 0.667111596054631, 0.223049675736034, 
    -0.378914489439789, 0.0684295049414218, -1.42962546140494, 
    -1.05496821244847, 1.0782583869058, -1.97519811660897, 0.0941678344561597, 
    1.31603570207323, 0.860230502563101, -0.691953579735508, 
    -0.525623808278522, -0.811157850282551, -0.37267968541869, 
    -0.144300474094259, 2.0243854962807, -0.862732809915694, 
    0.101494547691604, 1.3480292769345, 1.09644321475778, 0.298147209579714, 
    1.48512646965788, -0.394770304036291, -0.57219162069649, 
    1.03567881508872, 0.208031553577935, 0.0364826217307688, 
    -0.495192600326403, -0.344199664893686, 0.334055739427617, 
    0.664251222871164, 0.996646714587988, -1.2984594690649, -1.23312460416995, 
    -0.285366407024213, -2.11318134195741, 0.671996247135857, 
    -0.133555197508052, 0.614867598223588, -0.886396835838209, 
    -0.43266215215403, 0.212022497536239, 0.831908172773355, 
    -0.58998188166914, 0.0227085665384133, 0.67417614099501, 
    -0.0752122387594951), mahalanobis_pval = c(0.139010963711667, 
      0.139010963711667, 0.139010963711667, 0.139010963711667, 
      0.139010963711667, 0.139010963711667, 0.139010963711667, 
      0.41862905298802, 0.41862905298802, 0.41862905298802, 0.41862905298802, 
      0.106093385164085, 0.261525128692068, 0.261525128692068, 
      0.261525128692068, 0.748150762397249, 0.748150762397249, 
      0.748150762397249, 0.748150762397249, 0.748150762397249, 
      0.748150762397249, 0.748150762397249, 0.111307765365729, 
      0.111307765365729, 0.177097584954541, 0.177097584954541, 
      0.177097584954541, 0.177097584954541, 0.177097584954541, 
      0.0509621969151299, 0.0509621969151299, 0.0509621969151299, 
      0.0509621969151299, 0.0509621969151299, 0.0509621969151299, 
      0.0509621969151299, 0.726079886309858, 0.726079886309858, 
      0.726079886309858, 0.11026886689926, 0.11026886689926, 0.11026886689926, 
      0.11026886689926, 0.231324830828121, 0.231324830828121, 0.231324830828121, 
      0.231324830828121, 0.231324830828121, 0.231324830828121, 
      0.231324830828121, 0.784579758797424, 0.784579758797424, 
      0.784579758797424, 0.0658755199134844, 0.0658755199134844, 
      0.0658755199134844, 0.0658755199134844, 0.0658755199134844, 
      0.0658755199134844, 0.0658755199134844, 0.0403240691491778, 
      0.0403240691491778, 0.0403240691491778, 0.0403240691491778, 
      0.0403240691491778, 0.546656436681825, 0.546656436681825, 
      0.546656436681825, 0.546656436681825, 0.300447783181359, 
      0.300447783181359, 0.300447783181359, 0.300447783181359, 
      0.300447783181359, 0.300447783181359, 0.300447783181359, 
      0.188162059945556, 0.492670546225086, 0.492670546225086, 
      0.492670546225086, 0.492670546225086, 0.492670546225086, 
      0.492670546225086, 0.492670546225086, 0.462456251753305, 
      0.462456251753305, 0.462456251753305, 0.455068685458824, 
      0.455068685458824, 0.455068685458824, 0.455068685458824, 
      0.387766643031172, 0.387766643031172, 0.387766643031172, 
      0.387766643031172, 0.387766643031172, 0.387766643031172, 
      0.387766643031172, 0.510505956741367, 0.921036544549596, 
      0.921036544549596, 0.277710234694249, 0.277710234694249, 
      0.277710234694249, 0.277710234694249, 0.277710234694249, 
      0.277710234694249, 0.277710234694249, 0.559079603246253, 
      0.559079603246253, 0.559079603246253, 0.559079603246253, 
      0.680454915360415, 0.680454915360415, 0.680454915360415, 
      0.680454915360415, 0.680454915360415, 0.680454915360415, 
      0.345608428947576, 0.345608428947576, 0.345608428947576, 
      0.345608428947576, 0.345608428947576, 0.345608428947576, 
      0.620860337059473, 0.620860337059473, 0.620860337059473, 
      0.620860337059473, 0.620860337059473, 0.620860337059473, 
      0.620860337059473, 0.505133178280917, 0.505133178280917, 
      0.505133178280917, 0.505133178280917, 0.505133178280917, 
      0.505133178280917, 0.505133178280917, 0.0566969455221962, 
      0.0566969455221962, 0.0566969455221962, 0.0566969455221962, 
      0.62418375710606, 0.62418375710606, 0.62418375710606, 0.62418375710606, 
      0.475249465782893, 0.475249465782893, 0.475249465782893, 
      0.475249465782893, 0.475249465782893, 0.375209827013656, 
      0.375209827013656, 0.375209827013656, 0.375209827013656, 
      0.375209827013656, 0.375209827013656, 0.375209827013656, 
      0.890175033596184, 0.890175033596184, 0.890175033596184, 
      0.890175033596184, 0.890175033596184, 0.665744329755492, 
      0.665744329755492, 0.665744329755492, 0.665744329755492, 
      0.665744329755492, 0.665744329755492, 0.665744329755492, 
      0.296731912837223, 0.296731912837223, 0.296731912837223, 
      0.296731912837223, 0.296731912837223, 0.973132624155153, 
      0.973132624155153, 0.973132624155153, 0.973132624155153, 
      0.973132624155153, 0.973132624155153, 0.973132624155153, 
      0.306764945180458, 0.306764945180458, 0.306764945180458, 
      0.306764945180458, 0.306764945180458, 0.306764945180458, 
      0.306764945180458, 0.890915054287545, 0.890915054287545, 
      0.890915054287545, 0.890915054287545, 0.890915054287545, 
      0.890915054287545, 0.890915054287545, 0.478920160478914, 
      0.478920160478914, 0.478920160478914, 0.478920160478914, 
      0.658149670830434, 0.658149670830434, 0.658149670830434, 
      0.658149670830434, 0.658149670830434, 0.658149670830434, 
      0.658149670830434, 0.730181284011665, 0.730181284011665, 
      0.730181284011665, 0.730181284011665, 0.730181284011665, 
      0.730181284011665, 0.730181284011665, 0.274034645022713, 
      0.274034645022713, 0.274034645022713, 0.892600324832739, 
      0.892600324832739, 0.892600324832739, 0.892600324832739, 
      0.94295924754324, 0.94295924754324, 0.94295924754324, 0.94295924754324, 
      0.94295924754324, 0.94295924754324, 0.94295924754324, 0.803959432852725, 
      0.332066888257531, 0.332066888257531, 0.332066888257531, 
      0.332066888257531, 0.332066888257531, 0.332066888257531, 
      0.332066888257531, 0.971672863435016, 0.971672863435016, 
      0.65691814097626, 0.65691814097626, 0.65691814097626, 0.65691814097626, 
      0.65691814097626, 0.65691814097626, 0.65691814097626, 0.987791835808229, 
      0.987791835808229, 0.987791835808229, 0.987791835808229, 
      0.987791835808229, 0.987791835808229, 0.987791835808229)), row.names = c(1L, 
        2L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 
        20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 
        33L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 50L, 51L, 57L, 58L, 
        59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 71L, 72L, 73L, 74L, 
        75L, 76L, 78L, 79L, 80L, 81L, 82L, 83L, 85L, 86L, 87L, 88L, 89L, 
        90L, 91L, 92L, 93L, 94L, 95L, 96L, 97L, 98L, 99L, 100L, 101L, 
        102L, 106L, 107L, 108L, 109L, 113L, 114L, 115L, 116L, 117L, 120L, 
        121L, 122L, 123L, 124L, 125L, 126L, 127L, 128L, 129L, 130L, 131L, 
        132L, 133L, 134L, 135L, 136L, 137L, 138L, 139L, 140L, 141L, 142L, 
        143L, 144L, 148L, 149L, 150L, 155L, 156L, 157L, 158L, 159L, 160L, 
        161L, 162L, 163L, 164L, 165L, 166L, 167L, 168L, 169L, 170L, 171L, 
        172L, 176L, 177L, 178L, 179L, 180L, 181L, 182L, 183L, 184L, 185L, 
        186L, 187L, 188L, 189L, 190L, 191L, 192L, 197L, 198L, 199L, 200L, 
        204L, 205L, 206L, 207L, 208L, 209L, 210L, 211L, 218L, 219L, 220L, 
        221L, 222L, 223L, 224L, 225L, 226L, 232L, 233L, 234L, 235L, 236L, 
        237L, 238L, 239L, 240L, 241L, 242L, 243L, 244L, 245L, 246L, 247L, 
        248L, 249L, 253L, 260L, 261L, 262L, 267L, 268L, 269L, 270L, 271L, 
        274L, 275L, 276L, 281L, 282L, 283L, 284L, 288L, 289L, 290L, 291L, 
        292L, 293L, 294L, 295L, 302L, 303L, 304L, 305L, 306L, 307L, 308L, 
        309L, 310L, 311L, 316L, 317L, 318L, 319L, 323L, 324L, 325L, 326L, 
        327L, 330L, 331L, 332L, 333L, 334L, 335L, 336L, 337L, 338L, 339L, 
        340L, 341L, 344L, 345L, 346L, 347L, 348L, 349L, 350L), na.action = structure(c(`3` = 3L, 
          `4` = 4L, `5` = 5L, `6` = 6L, `7` = 7L, `34` = 34L, `35` = 35L, 
          `44` = 44L, `45` = 45L, `46` = 46L, `47` = 47L, `48` = 48L, `49` = 49L, 
          `52` = 52L, `53` = 53L, `54` = 54L, `55` = 55L, `56` = 56L, `68` = 68L, 
          `69` = 69L, `70` = 70L, `77` = 77L, `84` = 84L, `103` = 103L, 
          `104` = 104L, `105` = 105L, `110` = 110L, `111` = 111L, `112` = 112L, 
          `118` = 118L, `119` = 119L, `145` = 145L, `146` = 146L, `147` = 147L, 
          `151` = 151L, `152` = 152L, `153` = 153L, `154` = 154L, `173` = 173L, 
          `174` = 174L, `175` = 175L, `193` = 193L, `194` = 194L, `195` = 195L, 
          `196` = 196L, `201` = 201L, `202` = 202L, `203` = 203L, `212` = 212L, 
          `213` = 213L, `214` = 214L, `215` = 215L, `216` = 216L, `217` = 217L, 
          `227` = 227L, `228` = 228L, `229` = 229L, `230` = 230L, `231` = 231L, 
          `250` = 250L, `251` = 251L, `252` = 252L, `254` = 254L, `255` = 255L, 
          `256` = 256L, `257` = 257L, `258` = 258L, `259` = 259L, `263` = 263L, 
          `264` = 264L, `265` = 265L, `266` = 266L, `272` = 272L, `273` = 273L, 
          `277` = 277L, `278` = 278L, `279` = 279L, `280` = 280L, `285` = 285L, 
          `286` = 286L, `287` = 287L, `296` = 296L, `297` = 297L, `298` = 298L, 
          `299` = 299L, `300` = 300L, `301` = 301L, `312` = 312L, `313` = 313L, 
          `314` = 314L, `315` = 315L, `320` = 320L, `321` = 321L, `322` = 322L, 
          `328` = 328L, `329` = 329L, `342` = 342L, `343` = 343L), class = "omit"), class = "data.frame")

outlier <- "17"
library(ggplot2)
library(gghighlight)

p <- ggplot(rats, aes(x = time, y = response, group = subject, col = group)) +
  geom_line(alpha = .7) + geom_point(alpha = .5) +
  facet_grid(~ group) +
  xlab("Age [d]") +
  ylab("Distance [pixels]") +
  labs(title = "Rats data")
p

# renders

p + 
  gghighlight(subject %in% outlier, use_direct_label = TRUE, 
    label_key = subject, calculate_per_facet = TRUE)
#> New names:
#> * group -> group...4
#> * group -> group...5
#> Error: Must group by variables found in `.data`.
#> * Column `group` is not found.
# creates new name for it and then doesn't find the grouping variable anymore...?

Created on 2020-07-08 by the reprex package (v0.3.0)

Session info
sessionInfo()
#> R version 4.0.1 (2020-06-06)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Linux Mint 19.1
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
#>  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] gghighlight_0.3.0 ggplot2_3.3.2    
#> 
#> loaded via a namespace (and not attached):
#>  [1] pillar_1.4.4     compiler_4.0.1   highr_0.8        tools_4.0.1     
#>  [5] digest_0.6.25    evaluate_0.14    lifecycle_0.2.0  tibble_3.0.1    
#>  [9] gtable_0.3.0     pkgconfig_2.0.3  rlang_0.4.6      curl_4.3        
#> [13] yaml_2.2.1       xfun_0.15        withr_2.2.0      stringr_1.4.0   
#> [17] dplyr_1.0.0      httr_1.4.1       knitr_1.29       xml2_1.3.2      
#> [21] generics_0.0.2   vctrs_0.3.1      grid_4.0.1       tidyselect_1.1.0
#> [25] glue_1.4.1       R6_2.4.1         rmarkdown_2.2    purrr_0.3.4     
#> [29] farver_2.0.3     magrittr_1.5     scales_1.1.1     ellipsis_0.3.1  
#> [33] htmltools_0.5.0  mime_0.9         colorspace_1.4-1 labeling_0.3    
#> [37] stringi_1.4.6    munsell_0.5.0    crayon_1.3.4

Thanks, it seems so (sorry, I edited your comment because it's too long...).

Thanks, it seems so (sorry, I edited your comment because it's too long...).

well, it's no longer a reproducible example now... the data is here, if you need this for debugging later: https://pastebin.com/2FkCk5CK

For future reference, I really appreciate if you keep in mind providing a minimal reprex :) I think you don't need such a massive amount of lines to show something is also wrong with group column. Anyway, thanks for reporting!

Okay, I found the cause. Since I use dplyr::transmute() here, the later quasures might refer to the prior calculation results instead of the original data. Will fix.

data_evaluated <- dplyr::transmute(data, !!!mapping_wrapped)