rpremrajGit / mailR

14 stars 2 forks source link

Error when send kableExtra table #4

Open selesnow opened 2 years ago

selesnow commented 2 years ago

Hello, on previous versions of mailR i can sent HTML table makes with kableExtra package.

Yesterday i update mailR to 0.8 and get error:

Error in FUN(X[[i]], ...) : 
  Sorry, parameter type `kableExtra' is ambiguous or not supported.

Example code:

library(kableExtra)
library(mailR)

html_tab <- mtcars %>%
                    kable() %>%
                    kable_styling(bootstrap_options = c('bordered', 'hover'))

# try to send
  send.mail(from     = "me@gmail.com",
            to       = 'test@gmail.com', 
            subject  = 'mtcars table - test,
            body     = html_tab,
            encoding = "utf-8",
            inline   = TRUE,
            html     = TRUE,
            smtp     = list(host.name = config$email_smtp$host_name, 
                            port      = as.integer(config$email_smtp$port), 
                            user.name = config$email_smtp$user_name, 
                            passwd    = config$email_smtp$password,
                            ssl       = as.logical(config$email_smtp$ssl)),
            authenticate = TRUE,
            send = TRUE)
sclewis23 commented 2 years ago

Can you just put the html_tab in as.character(html_tab) ?

selesnow commented 2 years ago
library(kableExtra)

html_tab <- mtcars %>%
  kable() %>%
  kable_styling(bootstrap_options = c('bordered', 'hover'))

as.character(html_tab)
#> [1] "<table class=\"table table-bordered table-hover\" style=\"margin-left: auto; margin-right: auto;\">\n <thead>\n  <tr>\n   <th style=\"text-align:left;\">   </th>\n   <th style=\"text-align:right;\"> mpg </th>\n   <th style=\"text-align:right;\"> cyl </th>\n   <th style=\"text-align:right;\"> disp </th>\n   <th style=\"text-align:right;\"> hp </th>\n   <th style=\"text-align:right;\"> drat </th>\n   <th style=\"text-align:right;\"> wt </th>\n   <th style=\"text-align:right;\"> qsec </th>\n   <th style=\"text-align:right;\"> vs </th>\n   <th style=\"text-align:right;\"> am </th>\n   <th style=\"text-align:right;\"> gear </th>\n   <th style=\"text-align:right;\"> carb </th>\n  </tr>\n </thead>\n<tbody>\n  <tr>\n   <td style=\"text-align:left;\"> Mazda RX4 </td>\n   <td style=\"text-align:right;\"> 21.0 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 160.0 </td>\n   <td style=\"text-align:right;\"> 110 </td>\n   <td style=\"text-align:right;\"> 3.90 </td>\n   <td style=\"text-align:right;\"> 2.620 </td>\n   <td style=\"text-align:right;\"> 16.46 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Mazda RX4 Wag </td>\n   <td style=\"text-align:right;\"> 21.0 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 160.0 </td>\n   <td style=\"text-align:right;\"> 110 </td>\n   <td style=\"text-align:right;\"> 3.90 </td>\n   <td style=\"text-align:right;\"> 2.875 </td>\n   <td style=\"text-align:right;\"> 17.02 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Datsun 710 </td>\n   <td style=\"text-align:right;\"> 22.8 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 108.0 </td>\n   <td style=\"text-align:right;\"> 93 </td>\n   <td style=\"text-align:right;\"> 3.85 </td>\n   <td style=\"text-align:right;\"> 2.320 </td>\n   <td style=\"text-align:right;\"> 18.61 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Hornet 4 Drive </td>\n   <td style=\"text-align:right;\"> 21.4 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 258.0 </td>\n   <td style=\"text-align:right;\"> 110 </td>\n   <td style=\"text-align:right;\"> 3.08 </td>\n   <td style=\"text-align:right;\"> 3.215 </td>\n   <td style=\"text-align:right;\"> 19.44 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Hornet Sportabout </td>\n   <td style=\"text-align:right;\"> 18.7 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 360.0 </td>\n   <td style=\"text-align:right;\"> 175 </td>\n   <td style=\"text-align:right;\"> 3.15 </td>\n   <td style=\"text-align:right;\"> 3.440 </td>\n   <td style=\"text-align:right;\"> 17.02 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Valiant </td>\n   <td style=\"text-align:right;\"> 18.1 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 225.0 </td>\n   <td style=\"text-align:right;\"> 105 </td>\n   <td style=\"text-align:right;\"> 2.76 </td>\n   <td style=\"text-align:right;\"> 3.460 </td>\n   <td style=\"text-align:right;\"> 20.22 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Duster 360 </td>\n   <td style=\"text-align:right;\"> 14.3 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 360.0 </td>\n   <td style=\"text-align:right;\"> 245 </td>\n   <td style=\"text-align:right;\"> 3.21 </td>\n   <td style=\"text-align:right;\"> 3.570 </td>\n   <td style=\"text-align:right;\"> 15.84 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 240D </td>\n   <td style=\"text-align:right;\"> 24.4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 146.7 </td>\n   <td style=\"text-align:right;\"> 62 </td>\n   <td style=\"text-align:right;\"> 3.69 </td>\n   <td style=\"text-align:right;\"> 3.190 </td>\n   <td style=\"text-align:right;\"> 20.00 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 230 </td>\n   <td style=\"text-align:right;\"> 22.8 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 140.8 </td>\n   <td style=\"text-align:right;\"> 95 </td>\n   <td style=\"text-align:right;\"> 3.92 </td>\n   <td style=\"text-align:right;\"> 3.150 </td>\n   <td style=\"text-align:right;\"> 22.90 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 280 </td>\n   <td style=\"text-align:right;\"> 19.2 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 167.6 </td>\n   <td style=\"text-align:right;\"> 123 </td>\n   <td style=\"text-align:right;\"> 3.92 </td>\n   <td style=\"text-align:right;\"> 3.440 </td>\n   <td style=\"text-align:right;\"> 18.30 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 280C </td>\n   <td style=\"text-align:right;\"> 17.8 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 167.6 </td>\n   <td style=\"text-align:right;\"> 123 </td>\n   <td style=\"text-align:right;\"> 3.92 </td>\n   <td style=\"text-align:right;\"> 3.440 </td>\n   <td style=\"text-align:right;\"> 18.90 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 450SE </td>\n   <td style=\"text-align:right;\"> 16.4 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 275.8 </td>\n   <td style=\"text-align:right;\"> 180 </td>\n   <td style=\"text-align:right;\"> 3.07 </td>\n   <td style=\"text-align:right;\"> 4.070 </td>\n   <td style=\"text-align:right;\"> 17.40 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 450SL </td>\n   <td style=\"text-align:right;\"> 17.3 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 275.8 </td>\n   <td style=\"text-align:right;\"> 180 </td>\n   <td style=\"text-align:right;\"> 3.07 </td>\n   <td style=\"text-align:right;\"> 3.730 </td>\n   <td style=\"text-align:right;\"> 17.60 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Merc 450SLC </td>\n   <td style=\"text-align:right;\"> 15.2 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 275.8 </td>\n   <td style=\"text-align:right;\"> 180 </td>\n   <td style=\"text-align:right;\"> 3.07 </td>\n   <td style=\"text-align:right;\"> 3.780 </td>\n   <td style=\"text-align:right;\"> 18.00 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Cadillac Fleetwood </td>\n   <td style=\"text-align:right;\"> 10.4 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 472.0 </td>\n   <td style=\"text-align:right;\"> 205 </td>\n   <td style=\"text-align:right;\"> 2.93 </td>\n   <td style=\"text-align:right;\"> 5.250 </td>\n   <td style=\"text-align:right;\"> 17.98 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Lincoln Continental </td>\n   <td style=\"text-align:right;\"> 10.4 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 460.0 </td>\n   <td style=\"text-align:right;\"> 215 </td>\n   <td style=\"text-align:right;\"> 3.00 </td>\n   <td style=\"text-align:right;\"> 5.424 </td>\n   <td style=\"text-align:right;\"> 17.82 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Chrysler Imperial </td>\n   <td style=\"text-align:right;\"> 14.7 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 440.0 </td>\n   <td style=\"text-align:right;\"> 230 </td>\n   <td style=\"text-align:right;\"> 3.23 </td>\n   <td style=\"text-align:right;\"> 5.345 </td>\n   <td style=\"text-align:right;\"> 17.42 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Fiat 128 </td>\n   <td style=\"text-align:right;\"> 32.4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 78.7 </td>\n   <td style=\"text-align:right;\"> 66 </td>\n   <td style=\"text-align:right;\"> 4.08 </td>\n   <td style=\"text-align:right;\"> 2.200 </td>\n   <td style=\"text-align:right;\"> 19.47 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Honda Civic </td>\n   <td style=\"text-align:right;\"> 30.4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 75.7 </td>\n   <td style=\"text-align:right;\"> 52 </td>\n   <td style=\"text-align:right;\"> 4.93 </td>\n   <td style=\"text-align:right;\"> 1.615 </td>\n   <td style=\"text-align:right;\"> 18.52 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Toyota Corolla </td>\n   <td style=\"text-align:right;\"> 33.9 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 71.1 </td>\n   <td style=\"text-align:right;\"> 65 </td>\n   <td style=\"text-align:right;\"> 4.22 </td>\n   <td style=\"text-align:right;\"> 1.835 </td>\n   <td style=\"text-align:right;\"> 19.90 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Toyota Corona </td>\n   <td style=\"text-align:right;\"> 21.5 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 120.1 </td>\n   <td style=\"text-align:right;\"> 97 </td>\n   <td style=\"text-align:right;\"> 3.70 </td>\n   <td style=\"text-align:right;\"> 2.465 </td>\n   <td style=\"text-align:right;\"> 20.01 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Dodge Challenger </td>\n   <td style=\"text-align:right;\"> 15.5 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 318.0 </td>\n   <td style=\"text-align:right;\"> 150 </td>\n   <td style=\"text-align:right;\"> 2.76 </td>\n   <td style=\"text-align:right;\"> 3.520 </td>\n   <td style=\"text-align:right;\"> 16.87 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> AMC Javelin </td>\n   <td style=\"text-align:right;\"> 15.2 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 304.0 </td>\n   <td style=\"text-align:right;\"> 150 </td>\n   <td style=\"text-align:right;\"> 3.15 </td>\n   <td style=\"text-align:right;\"> 3.435 </td>\n   <td style=\"text-align:right;\"> 17.30 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Camaro Z28 </td>\n   <td style=\"text-align:right;\"> 13.3 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 350.0 </td>\n   <td style=\"text-align:right;\"> 245 </td>\n   <td style=\"text-align:right;\"> 3.73 </td>\n   <td style=\"text-align:right;\"> 3.840 </td>\n   <td style=\"text-align:right;\"> 15.41 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Pontiac Firebird </td>\n   <td style=\"text-align:right;\"> 19.2 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 400.0 </td>\n   <td style=\"text-align:right;\"> 175 </td>\n   <td style=\"text-align:right;\"> 3.08 </td>\n   <td style=\"text-align:right;\"> 3.845 </td>\n   <td style=\"text-align:right;\"> 17.05 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 3 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Fiat X1-9 </td>\n   <td style=\"text-align:right;\"> 27.3 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 79.0 </td>\n   <td style=\"text-align:right;\"> 66 </td>\n   <td style=\"text-align:right;\"> 4.08 </td>\n   <td style=\"text-align:right;\"> 1.935 </td>\n   <td style=\"text-align:right;\"> 18.90 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Porsche 914-2 </td>\n   <td style=\"text-align:right;\"> 26.0 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 120.3 </td>\n   <td style=\"text-align:right;\"> 91 </td>\n   <td style=\"text-align:right;\"> 4.43 </td>\n   <td style=\"text-align:right;\"> 2.140 </td>\n   <td style=\"text-align:right;\"> 16.70 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 5 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Lotus Europa </td>\n   <td style=\"text-align:right;\"> 30.4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 95.1 </td>\n   <td style=\"text-align:right;\"> 113 </td>\n   <td style=\"text-align:right;\"> 3.77 </td>\n   <td style=\"text-align:right;\"> 1.513 </td>\n   <td style=\"text-align:right;\"> 16.90 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 5 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Ford Pantera L </td>\n   <td style=\"text-align:right;\"> 15.8 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 351.0 </td>\n   <td style=\"text-align:right;\"> 264 </td>\n   <td style=\"text-align:right;\"> 4.22 </td>\n   <td style=\"text-align:right;\"> 3.170 </td>\n   <td style=\"text-align:right;\"> 14.50 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 5 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Ferrari Dino </td>\n   <td style=\"text-align:right;\"> 19.7 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n   <td style=\"text-align:right;\"> 145.0 </td>\n   <td style=\"text-align:right;\"> 175 </td>\n   <td style=\"text-align:right;\"> 3.62 </td>\n   <td style=\"text-align:right;\"> 2.770 </td>\n   <td style=\"text-align:right;\"> 15.50 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 5 </td>\n   <td style=\"text-align:right;\"> 6 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Maserati Bora </td>\n   <td style=\"text-align:right;\"> 15.0 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n   <td style=\"text-align:right;\"> 301.0 </td>\n   <td style=\"text-align:right;\"> 335 </td>\n   <td style=\"text-align:right;\"> 3.54 </td>\n   <td style=\"text-align:right;\"> 3.570 </td>\n   <td style=\"text-align:right;\"> 14.60 </td>\n   <td style=\"text-align:right;\"> 0 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 5 </td>\n   <td style=\"text-align:right;\"> 8 </td>\n  </tr>\n  <tr>\n   <td style=\"text-align:left;\"> Volvo 142E </td>\n   <td style=\"text-align:right;\"> 21.4 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 121.0 </td>\n   <td style=\"text-align:right;\"> 109 </td>\n   <td style=\"text-align:right;\"> 4.11 </td>\n   <td style=\"text-align:right;\"> 2.780 </td>\n   <td style=\"text-align:right;\"> 18.60 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 1 </td>\n   <td style=\"text-align:right;\"> 4 </td>\n   <td style=\"text-align:right;\"> 2 </td>\n  </tr>\n</tbody>\n</table>"

Created on 2022-01-11 by the reprex package (v2.0.1)

Session info ``` r sessioninfo::session_info() #> - Session info -------------------------------------------------------------- #> hash: palms up together: dark skin tone, person with skullcap: medium-dark skin tone, shaved ice #> #> setting value #> version R version 4.1.2 (2021-11-01) #> os Windows 10 x64 (build 19042) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Russian_Russia.1251 #> ctype Russian_Russia.1251 #> tz Europe/Helsinki #> date 2022-01-11 #> pandoc 2.14.0.3 @ C:/Program Files/RStudio/bin/pandoc/ (via rmarkdown) #> #> - Packages ------------------------------------------------------------------- #> package * version date (UTC) lib source #> backports 1.3.0 2021-10-27 [1] CRAN (R 4.1.1) #> cli 3.1.0 2021-10-27 [1] CRAN (R 4.1.1) #> colorspace 2.0-2 2021-06-24 [1] CRAN (R 4.1.1) #> crayon 1.4.2 2021-10-29 [1] CRAN (R 4.1.1) #> digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.1) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0) #> glue 1.5.0 2021-11-07 [1] CRAN (R 4.1.2) #> highr 0.9 2021-04-16 [1] CRAN (R 4.1.0) #> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.1) #> httr 1.4.2 2020-07-20 [1] CRAN (R 4.1.0) #> kableExtra * 1.3.4 2021-02-20 [1] CRAN (R 4.1.0) #> knitr 1.36 2021-09-29 [1] CRAN (R 4.1.1) #> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.3) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.1.0) #> pillar 1.6.4 2021-10-18 [1] CRAN (R 4.1.1) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0) #> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.1.0) #> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.1.0) #> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.1.0) #> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.1.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.1) #> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.1.1) #> rlang 0.4.12 2021-10-18 [1] CRAN (R 4.1.1) #> rmarkdown 2.11 2021-09-14 [1] CRAN (R 4.1.1) #> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.0) #> rvest 1.0.2 2021-10-16 [1] CRAN (R 4.1.1) #> scales 1.1.1 2020-05-11 [1] CRAN (R 4.1.0) #> sessioninfo 1.2.1 2021-11-02 [1] CRAN (R 4.1.2) #> stringi 1.7.6 2021-11-29 [1] CRAN (R 4.1.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0) #> styler 1.6.2 2021-09-23 [1] CRAN (R 4.1.1) #> svglite 2.0.0 2021-02-20 [1] CRAN (R 4.1.0) #> systemfonts 1.0.3 2021-10-13 [1] CRAN (R 4.1.1) #> tibble 3.1.6 2021-11-07 [1] CRAN (R 4.1.2) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.0) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0) #> viridisLite 0.4.0 2021-04-13 [1] CRAN (R 4.1.0) #> webshot 0.5.2 2019-11-22 [1] CRAN (R 4.1.0) #> withr 2.4.3 2021-11-30 [1] CRAN (R 4.1.2) #> xfun 0.28 2021-11-04 [1] CRAN (R 4.1.2) #> xml2 1.3.2 2020-04-23 [1] CRAN (R 4.1.0) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) #> #> [1] C:/Users/Alsey/Documents/R/win-library/4.0 #> [2] C:/Program Files/R/R-4.1.2/library #> #> ------------------------------------------------------------------------------ ```

When i use body = as.character(html_tab) or body = unclass(html_tab) it works, but previous versions did not require changing the class of such objects.