Why won't my RMD knit if the underlying code all functions good in the r script editor

So I am making an RMD, and the code functions perfectly in the rscript editor. But when I copy/paste that same exact code into my RMD script, it won't knit.

The top 90% of the RMD is all working good, but scroll down to literally the very bottom paragraphs where it says in big bold letters Why won’t this code below here knit right?

Here is my RMD file online when it is knitted up.

Is there a way I can show what the guts of the rmd look like?

I ran dput if thats helpful.

> dput(head(HND_plotlevel_Sec_B_df, 4)) 

structure(list(hhid = c(1L, 2L, 4L, 4L), x13n = c(79L, 79L, 81L, 
81L), X14 = c(701L, 701L, 701L, 701L), X15 = c(7L, 7L, 7L, 7L
), plot_ID = c(1L, 1L, 3L, 2L), plotcode = c(140381L, 240401L, 
440533L, 440532L), ID_Agricultor = c(4038L, 4040L, 4053L, 4053L
), B4 = c("sin nombre", "la rueda de montes", "el franton", "lindero"
), B5 = c(3L, 2L, 3L, 1L), B6 = c(3L, 1L, 1L, 1L), B6_99 = c("No aplica", 
"No aplica", "No aplica", "No aplica"), B7 = c(2L, 1L, 2L, 1L
), B8 = c(1L, 1L, 2L, 2L), B8_99 = c("No aplica", "No aplica", 
"No aplica", "No aplica"), B9a = c(6000L, NA, NA, NA), B9b = c(1000L, 
1000L, NA, NA), B10 = c(NA, NA, 167L, 167L), B10_99 = c("No aplica", 
"No aplica", "No aplica", "No aplica"), B11 = c(0.5, 0.25, 1, 
0.17), B12 = c(1L, 1L, 1L, 1L), B12_99 = c("No aplica", "No aplica", 
"No aplica", "No aplica"), B13 = c(1L, 2L, 2L, 2L), B14 = c(1L, 
888L, 888L, 888L), B14_99 = c("No aplica", "No aplica", "No aplica", 
"No aplica"), B15 = c(3L, 888L, 888L, 888L), B16 = c(10L, 5L, 
9L, 9L), B17 = c(1L, 2L, 2L, 2L), B18a = c(0L, 0L, 0L, 0L), B18a_99 = c("No aplica", 
"No aplica", "No aplica", "No aplica"), B18b = c(4L, 4L, 1L, 
1L), B18b_99 = c("No aplica", "No aplica", "No aplica", "No aplica"
), B18c = c(5L, 0L, 4L, 4L), B18c_99 = c("No aplic", "No aplic", 
"No aplic", "No aplic"), Comments = c("", "", "", ""), ID_agricultor = c(4038L, 
4040L, 4053L, 4053L), B19 = c(1L, 2L, 1L, 1L), B19_99 = c("no aplica", 
"no aplica", "no aplica", "no aplica"), B20 = c(1L, 1L, 1L, 1L
), B21 = c(2L, 4L, 4L, 4L), B22 = c(2L, 2L, 2L, 2L), B23 = c(2L, 
1L, 1L, 1L), B24 = c(1L, 2L, 2L, 2L), B25a = c(1L, 2L, 888L, 
888L), B25_a_99 = c("No aplica", "No aplica", "No aplica", "No aplica"
), B25b = c(50, 90, 888, 888), B25b_u = c("1,00    \xe59\x85^a", 
"1,00    \xe59\x85^a", "No aplica", "No aplica"), B26a = c(888L, 
1L, 888L, 888L), B26_a_99 = c("No aplica", "No aplica", "No aplica", 
"No aplica"), B26b = c(100, 80, 0, 0), B26b_u = c("888", "1,00    \x875n_\xf0\xdf", 
"888", "888"), B27 = c(0, 725, 0, 0), B28 = c(240, 50, 100, 100
), B29 = c(100, 0, 0, 0), B30 = c(0L, 0L, 0L, 0L), B31 = c(0L, 
380L, 100L, 100L), B32_99 = c("No aplica", "No aplica", "No aplica", 
"danli"), B33 = c(2L, 1L, 2L, 2L), B34 = c(2012L, 2012L, 1969L, 
2012L), B35 = c(20, 20, 63, 12), plotid = c("p1", "p1", "p3", 
"p2"), B32 = c(2L, 2L, 20L, 29L), X9 = c(3L, 5L, 77L, 77L), B36 = c(7L, 
5L, 1L, 2L), B36_99 = c("No aplica", "No aplica", "No aplica", 
"No aplica"), var_type = c(1L, 1L, 2L, 2L), var_dist_project = c(1L, 
1L, 2L, 2L), seed_source = c(1L, 1L, 0L, 0L), year_firsttime_planted_var = c(1L, 
1L, 44L, 1L), B37 = c(20, 20, 63, 12), B38 = c(888L, 888L, 888L, 
888L), B38_99 = c("No aplica", "No aplica", "No aplica", "No aplica"
), B39 = c(0L, 0L, 0L, 0L), B40 = c(1L, 1L, 2L, 2L), B41 = c(2L, 
1L, 77L, 1L), B42 = c(888L, 1L, 77L, 2L), B43 = c(1L, 6L, 4L, 
1L), B43_99 = c("No aplica", "No aplica", "No aplica", "No aplica"
), B44 = c(3L, 5L, 99L, 5L), B44_99 = c("No aplica", "No aplica", 
"tiene buena demanda", "No aplica"), B45 = c(2L, 99L, 0L, 0L), 
    B45_99 = c("No aplica", "no tiene tiempo para arranque", 
    "No aplica", "No aplica"), B46 = c(4L, 888L, 0L, 0L), B46_99 = c("No aplica", 
    "No aplica", "No aplica", "No aplica"), B47a = c(1L, 2L, 
    2L, 2L), B47b = c(888L, 2L, 2L, 2L), B47c = c("No aplica", 
    "No aplica", "No aplica", "No aplica"), B48 = c(100, 100, 
    220, 200), B49 = c(2L, 2L, 2L, 2L), B49_99 = c("No aplica", 
    "No aplica", "No aplica", "No aplica"), B50 = c(1L, 8L, 11L, 
    11L), B51 = c(2L, 3L, 3L, 3L), B52 = c(50, 0, 0, 0), B53 = c(50, 
    60, 100, 100), B54 = c(0, 0, 0, 0), B55 = c(0, 0, 0, 0), 
    B56 = c(0, 40, 120, 100), B57 = c(4L, 1L, 5L, 1L), B58 = c(888, 
    888, 888, 888), B59 = c(77L, 99L, 888L, 888L), B59_99 = c("No aplica", 
    "devolver 2 libras por 1 libra", "No aplica", "No aplica"
    ), X12 = c(1L, 2L, 1L, 1L), X18a = c(1L, 1L, 1L, 1L), A1 = c(30L, 
    42L, 53L, 53L), A2 = c(1L, 2L, 1L, 1L), B3_1 = c(2L, 2L, 
    1L, 1L), B3_2 = c(1L, 2L, 2L, 2L), B3_3 = c(1L, 2L, 1L, 1L
    ), B3_4 = c(2L, 1L, 2L, 2L), C5 = c(2L, 2L, 2L, 2L), C5_99 = c("No aplica", 
    "No aplica", "No aplica", "No aplica"), wgt = c(0.86132002, 
    0.86132002, 0.86132002, 0.86132002)), row.names = c(NA, 4L
), class = "data.frame")

Probably some dirty data, such as

\xe59\x85^a

that I see scattered throughout.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.