This page list the R code used in the book Smoothing Spline ANOVA Models (2nd Ed.) by Chong Gu (2013, Springer-Verlag), and you will need to install the gss package. See the R FAQ for the installations of base R and add-on packages.

Chapter 3
Example 3.1, page 95
Example 3.2, page 96
Example 3.3, page 99
Example 3.4, page 100
Example 3.5, page 102
Section 3.9.1, page 106
Section 3.9.2, page 107

Chapter 4
Example 4.1, page 126
Section 4.2.1, page 127
Section 4.3.4, page 140
Section 4.4.4, page 147
Section 4.5.4, page 161 (need the wtloss data in the MASS package)

Chapter 5
Section 5.4.2, page 188
Section 5.4.3, page 191
Section 5.4.4, page 193
Section 5.4.5, page 196
Section 5.4.6, page 199
Section 5.5.1, page 202
Section 5.5.2, page 203
Section 5.5.3, page 205
Section 5.5.4, page 208

Chapter 6
Section 6.2.6, page 222
Section 6.3.5, page 230
Section 6.4.1, page 231
Section 6.4.2, page 232

Chapter 7
Example 7.3, page 250
Example 7.4, page 251
Section 7.5.1, page 253
Section 7.5.2, page 254
Section 7.5.3, page 255
Section 7.6.4, page 260
Section 7.6.5, page 262
Section 7.7.4, page 266
Section 7.7.5, page 268
Section 7.8.6, page 274
Section 7.8.7, page 275 (need long execution time)

Chapter 8
Section 8.3.4, page 293
Section 8.4.1, page 295
Section 8.4.2, page 297
Section 8.5.3, page 300
Section 8.5.4, page 302
Section 8.6.3, page 305
Section 8.6.4, page 309
Section 8.6.5, page 311
Section 8.6.6, page 314

Chapter 10
Section 10.1.5, page 358
Section 10.1.6, page 359 (need lots of memory)
Section 10.3.4, page 369
Section 10.3.5, page 371
Section 10.4.4, page 376
Section 10.4.5, page 378