Convert data from wide to long format

wide2long(
  data,
  within_factors = c(),
  within_cols = c(),
  dv = "y",
  id = "id",
  sep = faux_options("sep")
)

Arguments

data

the tbl in wide format

within_factors

the names of the within factors

within_cols

the names (or indices) of the within-subject (value) columns

dv

the name of the dv column (defaults to "y")

id

the name of the ID column(s) if they don't exist, a new column will be made (defaults to ("id")

sep

separator for within-columns (to be used in strsplit, so can be regex), defaults to "_"

Value

a tbl in long format

Examples

wide2long(iris, c("Feature", "Measure"), 1:4, sep = "\\.")
#>       id    Species Feature Measure   y
#> 1   S001     setosa   Sepal  Length 5.1
#> 2   S002     setosa   Sepal  Length 4.9
#> 3   S003     setosa   Sepal  Length 4.7
#> 4   S004     setosa   Sepal  Length 4.6
#> 5   S005     setosa   Sepal  Length 5.0
#> 6   S006     setosa   Sepal  Length 5.4
#> 7   S007     setosa   Sepal  Length 4.6
#> 8   S008     setosa   Sepal  Length 5.0
#> 9   S009     setosa   Sepal  Length 4.4
#> 10  S010     setosa   Sepal  Length 4.9
#> 11  S011     setosa   Sepal  Length 5.4
#> 12  S012     setosa   Sepal  Length 4.8
#> 13  S013     setosa   Sepal  Length 4.8
#> 14  S014     setosa   Sepal  Length 4.3
#> 15  S015     setosa   Sepal  Length 5.8
#> 16  S016     setosa   Sepal  Length 5.7
#> 17  S017     setosa   Sepal  Length 5.4
#> 18  S018     setosa   Sepal  Length 5.1
#> 19  S019     setosa   Sepal  Length 5.7
#> 20  S020     setosa   Sepal  Length 5.1
#> 21  S021     setosa   Sepal  Length 5.4
#> 22  S022     setosa   Sepal  Length 5.1
#> 23  S023     setosa   Sepal  Length 4.6
#> 24  S024     setosa   Sepal  Length 5.1
#> 25  S025     setosa   Sepal  Length 4.8
#> 26  S026     setosa   Sepal  Length 5.0
#> 27  S027     setosa   Sepal  Length 5.0
#> 28  S028     setosa   Sepal  Length 5.2
#> 29  S029     setosa   Sepal  Length 5.2
#> 30  S030     setosa   Sepal  Length 4.7
#> 31  S031     setosa   Sepal  Length 4.8
#> 32  S032     setosa   Sepal  Length 5.4
#> 33  S033     setosa   Sepal  Length 5.2
#> 34  S034     setosa   Sepal  Length 5.5
#> 35  S035     setosa   Sepal  Length 4.9
#> 36  S036     setosa   Sepal  Length 5.0
#> 37  S037     setosa   Sepal  Length 5.5
#> 38  S038     setosa   Sepal  Length 4.9
#> 39  S039     setosa   Sepal  Length 4.4
#> 40  S040     setosa   Sepal  Length 5.1
#> 41  S041     setosa   Sepal  Length 5.0
#> 42  S042     setosa   Sepal  Length 4.5
#> 43  S043     setosa   Sepal  Length 4.4
#> 44  S044     setosa   Sepal  Length 5.0
#> 45  S045     setosa   Sepal  Length 5.1
#> 46  S046     setosa   Sepal  Length 4.8
#> 47  S047     setosa   Sepal  Length 5.1
#> 48  S048     setosa   Sepal  Length 4.6
#> 49  S049     setosa   Sepal  Length 5.3
#> 50  S050     setosa   Sepal  Length 5.0
#> 51  S051 versicolor   Sepal  Length 7.0
#> 52  S052 versicolor   Sepal  Length 6.4
#> 53  S053 versicolor   Sepal  Length 6.9
#> 54  S054 versicolor   Sepal  Length 5.5
#> 55  S055 versicolor   Sepal  Length 6.5
#> 56  S056 versicolor   Sepal  Length 5.7
#> 57  S057 versicolor   Sepal  Length 6.3
#> 58  S058 versicolor   Sepal  Length 4.9
#> 59  S059 versicolor   Sepal  Length 6.6
#> 60  S060 versicolor   Sepal  Length 5.2
#> 61  S061 versicolor   Sepal  Length 5.0
#> 62  S062 versicolor   Sepal  Length 5.9
#> 63  S063 versicolor   Sepal  Length 6.0
#> 64  S064 versicolor   Sepal  Length 6.1
#> 65  S065 versicolor   Sepal  Length 5.6
#> 66  S066 versicolor   Sepal  Length 6.7
#> 67  S067 versicolor   Sepal  Length 5.6
#> 68  S068 versicolor   Sepal  Length 5.8
#> 69  S069 versicolor   Sepal  Length 6.2
#> 70  S070 versicolor   Sepal  Length 5.6
#> 71  S071 versicolor   Sepal  Length 5.9
#> 72  S072 versicolor   Sepal  Length 6.1
#> 73  S073 versicolor   Sepal  Length 6.3
#> 74  S074 versicolor   Sepal  Length 6.1
#> 75  S075 versicolor   Sepal  Length 6.4
#> 76  S076 versicolor   Sepal  Length 6.6
#> 77  S077 versicolor   Sepal  Length 6.8
#> 78  S078 versicolor   Sepal  Length 6.7
#> 79  S079 versicolor   Sepal  Length 6.0
#> 80  S080 versicolor   Sepal  Length 5.7
#> 81  S081 versicolor   Sepal  Length 5.5
#> 82  S082 versicolor   Sepal  Length 5.5
#> 83  S083 versicolor   Sepal  Length 5.8
#> 84  S084 versicolor   Sepal  Length 6.0
#> 85  S085 versicolor   Sepal  Length 5.4
#> 86  S086 versicolor   Sepal  Length 6.0
#> 87  S087 versicolor   Sepal  Length 6.7
#> 88  S088 versicolor   Sepal  Length 6.3
#> 89  S089 versicolor   Sepal  Length 5.6
#> 90  S090 versicolor   Sepal  Length 5.5
#> 91  S091 versicolor   Sepal  Length 5.5
#> 92  S092 versicolor   Sepal  Length 6.1
#> 93  S093 versicolor   Sepal  Length 5.8
#> 94  S094 versicolor   Sepal  Length 5.0
#> 95  S095 versicolor   Sepal  Length 5.6
#> 96  S096 versicolor   Sepal  Length 5.7
#> 97  S097 versicolor   Sepal  Length 5.7
#> 98  S098 versicolor   Sepal  Length 6.2
#> 99  S099 versicolor   Sepal  Length 5.1
#> 100 S100 versicolor   Sepal  Length 5.7
#> 101 S101  virginica   Sepal  Length 6.3
#> 102 S102  virginica   Sepal  Length 5.8
#> 103 S103  virginica   Sepal  Length 7.1
#> 104 S104  virginica   Sepal  Length 6.3
#> 105 S105  virginica   Sepal  Length 6.5
#> 106 S106  virginica   Sepal  Length 7.6
#> 107 S107  virginica   Sepal  Length 4.9
#> 108 S108  virginica   Sepal  Length 7.3
#> 109 S109  virginica   Sepal  Length 6.7
#> 110 S110  virginica   Sepal  Length 7.2
#> 111 S111  virginica   Sepal  Length 6.5
#> 112 S112  virginica   Sepal  Length 6.4
#> 113 S113  virginica   Sepal  Length 6.8
#> 114 S114  virginica   Sepal  Length 5.7
#> 115 S115  virginica   Sepal  Length 5.8
#> 116 S116  virginica   Sepal  Length 6.4
#> 117 S117  virginica   Sepal  Length 6.5
#> 118 S118  virginica   Sepal  Length 7.7
#> 119 S119  virginica   Sepal  Length 7.7
#> 120 S120  virginica   Sepal  Length 6.0
#> 121 S121  virginica   Sepal  Length 6.9
#> 122 S122  virginica   Sepal  Length 5.6
#> 123 S123  virginica   Sepal  Length 7.7
#> 124 S124  virginica   Sepal  Length 6.3
#> 125 S125  virginica   Sepal  Length 6.7
#> 126 S126  virginica   Sepal  Length 7.2
#> 127 S127  virginica   Sepal  Length 6.2
#> 128 S128  virginica   Sepal  Length 6.1
#> 129 S129  virginica   Sepal  Length 6.4
#> 130 S130  virginica   Sepal  Length 7.2
#> 131 S131  virginica   Sepal  Length 7.4
#> 132 S132  virginica   Sepal  Length 7.9
#> 133 S133  virginica   Sepal  Length 6.4
#> 134 S134  virginica   Sepal  Length 6.3
#> 135 S135  virginica   Sepal  Length 6.1
#> 136 S136  virginica   Sepal  Length 7.7
#> 137 S137  virginica   Sepal  Length 6.3
#> 138 S138  virginica   Sepal  Length 6.4
#> 139 S139  virginica   Sepal  Length 6.0
#> 140 S140  virginica   Sepal  Length 6.9
#> 141 S141  virginica   Sepal  Length 6.7
#> 142 S142  virginica   Sepal  Length 6.9
#> 143 S143  virginica   Sepal  Length 5.8
#> 144 S144  virginica   Sepal  Length 6.8
#> 145 S145  virginica   Sepal  Length 6.7
#> 146 S146  virginica   Sepal  Length 6.7
#> 147 S147  virginica   Sepal  Length 6.3
#> 148 S148  virginica   Sepal  Length 6.5
#> 149 S149  virginica   Sepal  Length 6.2
#> 150 S150  virginica   Sepal  Length 5.9
#> 151 S001     setosa   Sepal   Width 3.5
#> 152 S002     setosa   Sepal   Width 3.0
#> 153 S003     setosa   Sepal   Width 3.2
#> 154 S004     setosa   Sepal   Width 3.1
#> 155 S005     setosa   Sepal   Width 3.6
#> 156 S006     setosa   Sepal   Width 3.9
#> 157 S007     setosa   Sepal   Width 3.4
#> 158 S008     setosa   Sepal   Width 3.4
#> 159 S009     setosa   Sepal   Width 2.9
#> 160 S010     setosa   Sepal   Width 3.1
#> 161 S011     setosa   Sepal   Width 3.7
#> 162 S012     setosa   Sepal   Width 3.4
#> 163 S013     setosa   Sepal   Width 3.0
#> 164 S014     setosa   Sepal   Width 3.0
#> 165 S015     setosa   Sepal   Width 4.0
#> 166 S016     setosa   Sepal   Width 4.4
#> 167 S017     setosa   Sepal   Width 3.9
#> 168 S018     setosa   Sepal   Width 3.5
#> 169 S019     setosa   Sepal   Width 3.8
#> 170 S020     setosa   Sepal   Width 3.8
#> 171 S021     setosa   Sepal   Width 3.4
#> 172 S022     setosa   Sepal   Width 3.7
#> 173 S023     setosa   Sepal   Width 3.6
#> 174 S024     setosa   Sepal   Width 3.3
#> 175 S025     setosa   Sepal   Width 3.4
#> 176 S026     setosa   Sepal   Width 3.0
#> 177 S027     setosa   Sepal   Width 3.4
#> 178 S028     setosa   Sepal   Width 3.5
#> 179 S029     setosa   Sepal   Width 3.4
#> 180 S030     setosa   Sepal   Width 3.2
#> 181 S031     setosa   Sepal   Width 3.1
#> 182 S032     setosa   Sepal   Width 3.4
#> 183 S033     setosa   Sepal   Width 4.1
#> 184 S034     setosa   Sepal   Width 4.2
#> 185 S035     setosa   Sepal   Width 3.1
#> 186 S036     setosa   Sepal   Width 3.2
#> 187 S037     setosa   Sepal   Width 3.5
#> 188 S038     setosa   Sepal   Width 3.6
#> 189 S039     setosa   Sepal   Width 3.0
#> 190 S040     setosa   Sepal   Width 3.4
#> 191 S041     setosa   Sepal   Width 3.5
#> 192 S042     setosa   Sepal   Width 2.3
#> 193 S043     setosa   Sepal   Width 3.2
#> 194 S044     setosa   Sepal   Width 3.5
#> 195 S045     setosa   Sepal   Width 3.8
#> 196 S046     setosa   Sepal   Width 3.0
#> 197 S047     setosa   Sepal   Width 3.8
#> 198 S048     setosa   Sepal   Width 3.2
#> 199 S049     setosa   Sepal   Width 3.7
#> 200 S050     setosa   Sepal   Width 3.3
#> 201 S051 versicolor   Sepal   Width 3.2
#> 202 S052 versicolor   Sepal   Width 3.2
#> 203 S053 versicolor   Sepal   Width 3.1
#> 204 S054 versicolor   Sepal   Width 2.3
#> 205 S055 versicolor   Sepal   Width 2.8
#> 206 S056 versicolor   Sepal   Width 2.8
#> 207 S057 versicolor   Sepal   Width 3.3
#> 208 S058 versicolor   Sepal   Width 2.4
#> 209 S059 versicolor   Sepal   Width 2.9
#> 210 S060 versicolor   Sepal   Width 2.7
#> 211 S061 versicolor   Sepal   Width 2.0
#> 212 S062 versicolor   Sepal   Width 3.0
#> 213 S063 versicolor   Sepal   Width 2.2
#> 214 S064 versicolor   Sepal   Width 2.9
#> 215 S065 versicolor   Sepal   Width 2.9
#> 216 S066 versicolor   Sepal   Width 3.1
#> 217 S067 versicolor   Sepal   Width 3.0
#> 218 S068 versicolor   Sepal   Width 2.7
#> 219 S069 versicolor   Sepal   Width 2.2
#> 220 S070 versicolor   Sepal   Width 2.5
#> 221 S071 versicolor   Sepal   Width 3.2
#> 222 S072 versicolor   Sepal   Width 2.8
#> 223 S073 versicolor   Sepal   Width 2.5
#> 224 S074 versicolor   Sepal   Width 2.8
#> 225 S075 versicolor   Sepal   Width 2.9
#> 226 S076 versicolor   Sepal   Width 3.0
#> 227 S077 versicolor   Sepal   Width 2.8
#> 228 S078 versicolor   Sepal   Width 3.0
#> 229 S079 versicolor   Sepal   Width 2.9
#> 230 S080 versicolor   Sepal   Width 2.6
#> 231 S081 versicolor   Sepal   Width 2.4
#> 232 S082 versicolor   Sepal   Width 2.4
#> 233 S083 versicolor   Sepal   Width 2.7
#> 234 S084 versicolor   Sepal   Width 2.7
#> 235 S085 versicolor   Sepal   Width 3.0
#> 236 S086 versicolor   Sepal   Width 3.4
#> 237 S087 versicolor   Sepal   Width 3.1
#> 238 S088 versicolor   Sepal   Width 2.3
#> 239 S089 versicolor   Sepal   Width 3.0
#> 240 S090 versicolor   Sepal   Width 2.5
#> 241 S091 versicolor   Sepal   Width 2.6
#> 242 S092 versicolor   Sepal   Width 3.0
#> 243 S093 versicolor   Sepal   Width 2.6
#> 244 S094 versicolor   Sepal   Width 2.3
#> 245 S095 versicolor   Sepal   Width 2.7
#> 246 S096 versicolor   Sepal   Width 3.0
#> 247 S097 versicolor   Sepal   Width 2.9
#> 248 S098 versicolor   Sepal   Width 2.9
#> 249 S099 versicolor   Sepal   Width 2.5
#> 250 S100 versicolor   Sepal   Width 2.8
#> 251 S101  virginica   Sepal   Width 3.3
#> 252 S102  virginica   Sepal   Width 2.7
#> 253 S103  virginica   Sepal   Width 3.0
#> 254 S104  virginica   Sepal   Width 2.9
#> 255 S105  virginica   Sepal   Width 3.0
#> 256 S106  virginica   Sepal   Width 3.0
#> 257 S107  virginica   Sepal   Width 2.5
#> 258 S108  virginica   Sepal   Width 2.9
#> 259 S109  virginica   Sepal   Width 2.5
#> 260 S110  virginica   Sepal   Width 3.6
#> 261 S111  virginica   Sepal   Width 3.2
#> 262 S112  virginica   Sepal   Width 2.7
#> 263 S113  virginica   Sepal   Width 3.0
#> 264 S114  virginica   Sepal   Width 2.5
#> 265 S115  virginica   Sepal   Width 2.8
#> 266 S116  virginica   Sepal   Width 3.2
#> 267 S117  virginica   Sepal   Width 3.0
#> 268 S118  virginica   Sepal   Width 3.8
#> 269 S119  virginica   Sepal   Width 2.6
#> 270 S120  virginica   Sepal   Width 2.2
#> 271 S121  virginica   Sepal   Width 3.2
#> 272 S122  virginica   Sepal   Width 2.8
#> 273 S123  virginica   Sepal   Width 2.8
#> 274 S124  virginica   Sepal   Width 2.7
#> 275 S125  virginica   Sepal   Width 3.3
#> 276 S126  virginica   Sepal   Width 3.2
#> 277 S127  virginica   Sepal   Width 2.8
#> 278 S128  virginica   Sepal   Width 3.0
#> 279 S129  virginica   Sepal   Width 2.8
#> 280 S130  virginica   Sepal   Width 3.0
#> 281 S131  virginica   Sepal   Width 2.8
#> 282 S132  virginica   Sepal   Width 3.8
#> 283 S133  virginica   Sepal   Width 2.8
#> 284 S134  virginica   Sepal   Width 2.8
#> 285 S135  virginica   Sepal   Width 2.6
#> 286 S136  virginica   Sepal   Width 3.0
#> 287 S137  virginica   Sepal   Width 3.4
#> 288 S138  virginica   Sepal   Width 3.1
#> 289 S139  virginica   Sepal   Width 3.0
#> 290 S140  virginica   Sepal   Width 3.1
#> 291 S141  virginica   Sepal   Width 3.1
#> 292 S142  virginica   Sepal   Width 3.1
#> 293 S143  virginica   Sepal   Width 2.7
#> 294 S144  virginica   Sepal   Width 3.2
#> 295 S145  virginica   Sepal   Width 3.3
#> 296 S146  virginica   Sepal   Width 3.0
#> 297 S147  virginica   Sepal   Width 2.5
#> 298 S148  virginica   Sepal   Width 3.0
#> 299 S149  virginica   Sepal   Width 3.4
#> 300 S150  virginica   Sepal   Width 3.0
#> 301 S001     setosa   Petal  Length 1.4
#> 302 S002     setosa   Petal  Length 1.4
#> 303 S003     setosa   Petal  Length 1.3
#> 304 S004     setosa   Petal  Length 1.5
#> 305 S005     setosa   Petal  Length 1.4
#> 306 S006     setosa   Petal  Length 1.7
#> 307 S007     setosa   Petal  Length 1.4
#> 308 S008     setosa   Petal  Length 1.5
#> 309 S009     setosa   Petal  Length 1.4
#> 310 S010     setosa   Petal  Length 1.5
#> 311 S011     setosa   Petal  Length 1.5
#> 312 S012     setosa   Petal  Length 1.6
#> 313 S013     setosa   Petal  Length 1.4
#> 314 S014     setosa   Petal  Length 1.1
#> 315 S015     setosa   Petal  Length 1.2
#> 316 S016     setosa   Petal  Length 1.5
#> 317 S017     setosa   Petal  Length 1.3
#> 318 S018     setosa   Petal  Length 1.4
#> 319 S019     setosa   Petal  Length 1.7
#> 320 S020     setosa   Petal  Length 1.5
#> 321 S021     setosa   Petal  Length 1.7
#> 322 S022     setosa   Petal  Length 1.5
#> 323 S023     setosa   Petal  Length 1.0
#> 324 S024     setosa   Petal  Length 1.7
#> 325 S025     setosa   Petal  Length 1.9
#> 326 S026     setosa   Petal  Length 1.6
#> 327 S027     setosa   Petal  Length 1.6
#> 328 S028     setosa   Petal  Length 1.5
#> 329 S029     setosa   Petal  Length 1.4
#> 330 S030     setosa   Petal  Length 1.6
#> 331 S031     setosa   Petal  Length 1.6
#> 332 S032     setosa   Petal  Length 1.5
#> 333 S033     setosa   Petal  Length 1.5
#> 334 S034     setosa   Petal  Length 1.4
#> 335 S035     setosa   Petal  Length 1.5
#> 336 S036     setosa   Petal  Length 1.2
#> 337 S037     setosa   Petal  Length 1.3
#> 338 S038     setosa   Petal  Length 1.4
#> 339 S039     setosa   Petal  Length 1.3
#> 340 S040     setosa   Petal  Length 1.5
#> 341 S041     setosa   Petal  Length 1.3
#> 342 S042     setosa   Petal  Length 1.3
#> 343 S043     setosa   Petal  Length 1.3
#> 344 S044     setosa   Petal  Length 1.6
#> 345 S045     setosa   Petal  Length 1.9
#> 346 S046     setosa   Petal  Length 1.4
#> 347 S047     setosa   Petal  Length 1.6
#> 348 S048     setosa   Petal  Length 1.4
#> 349 S049     setosa   Petal  Length 1.5
#> 350 S050     setosa   Petal  Length 1.4
#> 351 S051 versicolor   Petal  Length 4.7
#> 352 S052 versicolor   Petal  Length 4.5
#> 353 S053 versicolor   Petal  Length 4.9
#> 354 S054 versicolor   Petal  Length 4.0
#> 355 S055 versicolor   Petal  Length 4.6
#> 356 S056 versicolor   Petal  Length 4.5
#> 357 S057 versicolor   Petal  Length 4.7
#> 358 S058 versicolor   Petal  Length 3.3
#> 359 S059 versicolor   Petal  Length 4.6
#> 360 S060 versicolor   Petal  Length 3.9
#> 361 S061 versicolor   Petal  Length 3.5
#> 362 S062 versicolor   Petal  Length 4.2
#> 363 S063 versicolor   Petal  Length 4.0
#> 364 S064 versicolor   Petal  Length 4.7
#> 365 S065 versicolor   Petal  Length 3.6
#> 366 S066 versicolor   Petal  Length 4.4
#> 367 S067 versicolor   Petal  Length 4.5
#> 368 S068 versicolor   Petal  Length 4.1
#> 369 S069 versicolor   Petal  Length 4.5
#> 370 S070 versicolor   Petal  Length 3.9
#> 371 S071 versicolor   Petal  Length 4.8
#> 372 S072 versicolor   Petal  Length 4.0
#> 373 S073 versicolor   Petal  Length 4.9
#> 374 S074 versicolor   Petal  Length 4.7
#> 375 S075 versicolor   Petal  Length 4.3
#> 376 S076 versicolor   Petal  Length 4.4
#> 377 S077 versicolor   Petal  Length 4.8
#> 378 S078 versicolor   Petal  Length 5.0
#> 379 S079 versicolor   Petal  Length 4.5
#> 380 S080 versicolor   Petal  Length 3.5
#> 381 S081 versicolor   Petal  Length 3.8
#> 382 S082 versicolor   Petal  Length 3.7
#> 383 S083 versicolor   Petal  Length 3.9
#> 384 S084 versicolor   Petal  Length 5.1
#> 385 S085 versicolor   Petal  Length 4.5
#> 386 S086 versicolor   Petal  Length 4.5
#> 387 S087 versicolor   Petal  Length 4.7
#> 388 S088 versicolor   Petal  Length 4.4
#> 389 S089 versicolor   Petal  Length 4.1
#> 390 S090 versicolor   Petal  Length 4.0
#> 391 S091 versicolor   Petal  Length 4.4
#> 392 S092 versicolor   Petal  Length 4.6
#> 393 S093 versicolor   Petal  Length 4.0
#> 394 S094 versicolor   Petal  Length 3.3
#> 395 S095 versicolor   Petal  Length 4.2
#> 396 S096 versicolor   Petal  Length 4.2
#> 397 S097 versicolor   Petal  Length 4.2
#> 398 S098 versicolor   Petal  Length 4.3
#> 399 S099 versicolor   Petal  Length 3.0
#> 400 S100 versicolor   Petal  Length 4.1
#> 401 S101  virginica   Petal  Length 6.0
#> 402 S102  virginica   Petal  Length 5.1
#> 403 S103  virginica   Petal  Length 5.9
#> 404 S104  virginica   Petal  Length 5.6
#> 405 S105  virginica   Petal  Length 5.8
#> 406 S106  virginica   Petal  Length 6.6
#> 407 S107  virginica   Petal  Length 4.5
#> 408 S108  virginica   Petal  Length 6.3
#> 409 S109  virginica   Petal  Length 5.8
#> 410 S110  virginica   Petal  Length 6.1
#> 411 S111  virginica   Petal  Length 5.1
#> 412 S112  virginica   Petal  Length 5.3
#> 413 S113  virginica   Petal  Length 5.5
#> 414 S114  virginica   Petal  Length 5.0
#> 415 S115  virginica   Petal  Length 5.1
#> 416 S116  virginica   Petal  Length 5.3
#> 417 S117  virginica   Petal  Length 5.5
#> 418 S118  virginica   Petal  Length 6.7
#> 419 S119  virginica   Petal  Length 6.9
#> 420 S120  virginica   Petal  Length 5.0
#> 421 S121  virginica   Petal  Length 5.7
#> 422 S122  virginica   Petal  Length 4.9
#> 423 S123  virginica   Petal  Length 6.7
#> 424 S124  virginica   Petal  Length 4.9
#> 425 S125  virginica   Petal  Length 5.7
#> 426 S126  virginica   Petal  Length 6.0
#> 427 S127  virginica   Petal  Length 4.8
#> 428 S128  virginica   Petal  Length 4.9
#> 429 S129  virginica   Petal  Length 5.6
#> 430 S130  virginica   Petal  Length 5.8
#> 431 S131  virginica   Petal  Length 6.1
#> 432 S132  virginica   Petal  Length 6.4
#> 433 S133  virginica   Petal  Length 5.6
#> 434 S134  virginica   Petal  Length 5.1
#> 435 S135  virginica   Petal  Length 5.6
#> 436 S136  virginica   Petal  Length 6.1
#> 437 S137  virginica   Petal  Length 5.6
#> 438 S138  virginica   Petal  Length 5.5
#> 439 S139  virginica   Petal  Length 4.8
#> 440 S140  virginica   Petal  Length 5.4
#> 441 S141  virginica   Petal  Length 5.6
#> 442 S142  virginica   Petal  Length 5.1
#> 443 S143  virginica   Petal  Length 5.1
#> 444 S144  virginica   Petal  Length 5.9
#> 445 S145  virginica   Petal  Length 5.7
#> 446 S146  virginica   Petal  Length 5.2
#> 447 S147  virginica   Petal  Length 5.0
#> 448 S148  virginica   Petal  Length 5.2
#> 449 S149  virginica   Petal  Length 5.4
#> 450 S150  virginica   Petal  Length 5.1
#> 451 S001     setosa   Petal   Width 0.2
#> 452 S002     setosa   Petal   Width 0.2
#> 453 S003     setosa   Petal   Width 0.2
#> 454 S004     setosa   Petal   Width 0.2
#> 455 S005     setosa   Petal   Width 0.2
#> 456 S006     setosa   Petal   Width 0.4
#> 457 S007     setosa   Petal   Width 0.3
#> 458 S008     setosa   Petal   Width 0.2
#> 459 S009     setosa   Petal   Width 0.2
#> 460 S010     setosa   Petal   Width 0.1
#> 461 S011     setosa   Petal   Width 0.2
#> 462 S012     setosa   Petal   Width 0.2
#> 463 S013     setosa   Petal   Width 0.1
#> 464 S014     setosa   Petal   Width 0.1
#> 465 S015     setosa   Petal   Width 0.2
#> 466 S016     setosa   Petal   Width 0.4
#> 467 S017     setosa   Petal   Width 0.4
#> 468 S018     setosa   Petal   Width 0.3
#> 469 S019     setosa   Petal   Width 0.3
#> 470 S020     setosa   Petal   Width 0.3
#> 471 S021     setosa   Petal   Width 0.2
#> 472 S022     setosa   Petal   Width 0.4
#> 473 S023     setosa   Petal   Width 0.2
#> 474 S024     setosa   Petal   Width 0.5
#> 475 S025     setosa   Petal   Width 0.2
#> 476 S026     setosa   Petal   Width 0.2
#> 477 S027     setosa   Petal   Width 0.4
#> 478 S028     setosa   Petal   Width 0.2
#> 479 S029     setosa   Petal   Width 0.2
#> 480 S030     setosa   Petal   Width 0.2
#> 481 S031     setosa   Petal   Width 0.2
#> 482 S032     setosa   Petal   Width 0.4
#> 483 S033     setosa   Petal   Width 0.1
#> 484 S034     setosa   Petal   Width 0.2
#> 485 S035     setosa   Petal   Width 0.2
#> 486 S036     setosa   Petal   Width 0.2
#> 487 S037     setosa   Petal   Width 0.2
#> 488 S038     setosa   Petal   Width 0.1
#> 489 S039     setosa   Petal   Width 0.2
#> 490 S040     setosa   Petal   Width 0.2
#> 491 S041     setosa   Petal   Width 0.3
#> 492 S042     setosa   Petal   Width 0.3
#> 493 S043     setosa   Petal   Width 0.2
#> 494 S044     setosa   Petal   Width 0.6
#> 495 S045     setosa   Petal   Width 0.4
#> 496 S046     setosa   Petal   Width 0.3
#> 497 S047     setosa   Petal   Width 0.2
#> 498 S048     setosa   Petal   Width 0.2
#> 499 S049     setosa   Petal   Width 0.2
#> 500 S050     setosa   Petal   Width 0.2
#> 501 S051 versicolor   Petal   Width 1.4
#> 502 S052 versicolor   Petal   Width 1.5
#> 503 S053 versicolor   Petal   Width 1.5
#> 504 S054 versicolor   Petal   Width 1.3
#> 505 S055 versicolor   Petal   Width 1.5
#> 506 S056 versicolor   Petal   Width 1.3
#> 507 S057 versicolor   Petal   Width 1.6
#> 508 S058 versicolor   Petal   Width 1.0
#> 509 S059 versicolor   Petal   Width 1.3
#> 510 S060 versicolor   Petal   Width 1.4
#> 511 S061 versicolor   Petal   Width 1.0
#> 512 S062 versicolor   Petal   Width 1.5
#> 513 S063 versicolor   Petal   Width 1.0
#> 514 S064 versicolor   Petal   Width 1.4
#> 515 S065 versicolor   Petal   Width 1.3
#> 516 S066 versicolor   Petal   Width 1.4
#> 517 S067 versicolor   Petal   Width 1.5
#> 518 S068 versicolor   Petal   Width 1.0
#> 519 S069 versicolor   Petal   Width 1.5
#> 520 S070 versicolor   Petal   Width 1.1
#> 521 S071 versicolor   Petal   Width 1.8
#> 522 S072 versicolor   Petal   Width 1.3
#> 523 S073 versicolor   Petal   Width 1.5
#> 524 S074 versicolor   Petal   Width 1.2
#> 525 S075 versicolor   Petal   Width 1.3
#> 526 S076 versicolor   Petal   Width 1.4
#> 527 S077 versicolor   Petal   Width 1.4
#> 528 S078 versicolor   Petal   Width 1.7
#> 529 S079 versicolor   Petal   Width 1.5
#> 530 S080 versicolor   Petal   Width 1.0
#> 531 S081 versicolor   Petal   Width 1.1
#> 532 S082 versicolor   Petal   Width 1.0
#> 533 S083 versicolor   Petal   Width 1.2
#> 534 S084 versicolor   Petal   Width 1.6
#> 535 S085 versicolor   Petal   Width 1.5
#> 536 S086 versicolor   Petal   Width 1.6
#> 537 S087 versicolor   Petal   Width 1.5
#> 538 S088 versicolor   Petal   Width 1.3
#> 539 S089 versicolor   Petal   Width 1.3
#> 540 S090 versicolor   Petal   Width 1.3
#> 541 S091 versicolor   Petal   Width 1.2
#> 542 S092 versicolor   Petal   Width 1.4
#> 543 S093 versicolor   Petal   Width 1.2
#> 544 S094 versicolor   Petal   Width 1.0
#> 545 S095 versicolor   Petal   Width 1.3
#> 546 S096 versicolor   Petal   Width 1.2
#> 547 S097 versicolor   Petal   Width 1.3
#> 548 S098 versicolor   Petal   Width 1.3
#> 549 S099 versicolor   Petal   Width 1.1
#> 550 S100 versicolor   Petal   Width 1.3
#> 551 S101  virginica   Petal   Width 2.5
#> 552 S102  virginica   Petal   Width 1.9
#> 553 S103  virginica   Petal   Width 2.1
#> 554 S104  virginica   Petal   Width 1.8
#> 555 S105  virginica   Petal   Width 2.2
#> 556 S106  virginica   Petal   Width 2.1
#> 557 S107  virginica   Petal   Width 1.7
#> 558 S108  virginica   Petal   Width 1.8
#> 559 S109  virginica   Petal   Width 1.8
#> 560 S110  virginica   Petal   Width 2.5
#> 561 S111  virginica   Petal   Width 2.0
#> 562 S112  virginica   Petal   Width 1.9
#> 563 S113  virginica   Petal   Width 2.1
#> 564 S114  virginica   Petal   Width 2.0
#> 565 S115  virginica   Petal   Width 2.4
#> 566 S116  virginica   Petal   Width 2.3
#> 567 S117  virginica   Petal   Width 1.8
#> 568 S118  virginica   Petal   Width 2.2
#> 569 S119  virginica   Petal   Width 2.3
#> 570 S120  virginica   Petal   Width 1.5
#> 571 S121  virginica   Petal   Width 2.3
#> 572 S122  virginica   Petal   Width 2.0
#> 573 S123  virginica   Petal   Width 2.0
#> 574 S124  virginica   Petal   Width 1.8
#> 575 S125  virginica   Petal   Width 2.1
#> 576 S126  virginica   Petal   Width 1.8
#> 577 S127  virginica   Petal   Width 1.8
#> 578 S128  virginica   Petal   Width 1.8
#> 579 S129  virginica   Petal   Width 2.1
#> 580 S130  virginica   Petal   Width 1.6
#> 581 S131  virginica   Petal   Width 1.9
#> 582 S132  virginica   Petal   Width 2.0
#> 583 S133  virginica   Petal   Width 2.2
#> 584 S134  virginica   Petal   Width 1.5
#> 585 S135  virginica   Petal   Width 1.4
#> 586 S136  virginica   Petal   Width 2.3
#> 587 S137  virginica   Petal   Width 2.4
#> 588 S138  virginica   Petal   Width 1.8
#> 589 S139  virginica   Petal   Width 1.8
#> 590 S140  virginica   Petal   Width 2.1
#> 591 S141  virginica   Petal   Width 2.4
#> 592 S142  virginica   Petal   Width 2.3
#> 593 S143  virginica   Petal   Width 1.9
#> 594 S144  virginica   Petal   Width 2.3
#> 595 S145  virginica   Petal   Width 2.5
#> 596 S146  virginica   Petal   Width 2.3
#> 597 S147  virginica   Petal   Width 1.9
#> 598 S148  virginica   Petal   Width 2.0
#> 599 S149  virginica   Petal   Width 2.3
#> 600 S150  virginica   Petal   Width 1.8