Error knitting to HTML

  • Error knitting to HTML

     David updated 1 month, 2 weeks ago 2Members · 8 Posts
  • jordan.trachtenberg

    Member
    December 1, 2020 at 9:05 am

    I get an error when I try to knit my document to HTML but not Word. Here is my output setup:

    ---

    title: "Course Evaluations by Delivery Mode"

    author: "Jordan Trachtenberg"

    date: "r Sys.Date()"

    output:

    html_document:

    df_print: paged

    toc: yes

    toc_depth: 3 # up to 3 depths of headings (specified by #, ##, and ###)

    number_sections: true # if you want to number sections at each table header

    theme: united # theme option

    highlight: tango # specifies the syntax highlighting style

    toc_float: yes

    word_document:

    toc: yes

    toc_depth: '3'

    number_sections: true

    ---

    Line 313:

    total_fy_sections <- course_evals %>%

    filter((course %in% c("BE491", "BE560", "EMGT445")) == FALSE,

    question_key == "226882-0",

    startsWith(course_level, "100"),

    endsWith(course, "L") == FALSE,

    quarter == "2020-2021 Fall") %>%

    distinct(course_unique_id, mdc_course_delivery_mode, quarter, dept, course, course_level, section, mean) %>%

    group_by(dept, quarter) %>%

    summarize(all_sections = n_distinct(course_unique_id)) %>%

    ungroup

    Error message:

    Line 313 Error: Problem with filter() input ...3. x object 'course_level' not found i Input ..3 is startsWith(course_level, "100").

    Any idea why this is happening? I know that course_level is in my course_evals data frame, and it runs just fine and outputs my Word file correctly. Thanks!

  • David

    Organizer
    December 1, 2020 at 1:33 pm

    Hmm, this is very strange. It’s a bit hard to diagnose this without seeing the data. Any chance you could make a deidentified dataset that you could upload here so I could test it out?

  • jordan.trachtenberg

    Member
    December 1, 2020 at 1:55 pm

    Thanks, @dgkeyes . I did run clean_names on the dataset when I imported it. Here is a sample file below.

    # Read the data

    read_evals <- readr::read_csv('DeidentifiedData.csv')

    # Display dataframe

    read_evals

    # Then clean the column names so that they are all lowercase, etc.

    course_evals <- read_evals %>%

    clean_names()

    # Display dataframe

    course_evals

    This file was truncated for preview. Please download to view the full file.
  • David

    Organizer
    December 1, 2020 at 8:21 pm

    Great, thanks for the info @jordan-trachtenberg . Would you be ok with going over this in this Friday’s office hours session?

  • jordan.trachtenberg

    Member
    December 2, 2020 at 5:52 am

    That would be great. Thanks!

  • David

    Organizer
    December 2, 2020 at 9:59 am

    Great, it’s a plan!

  • jordan.trachtenberg

    Member
    December 4, 2020 at 6:52 am

    @dgkeyes, I updated all of my packages this morning, and now knitting to HTML seems to be working. I didn’t have to change any of my code either. Maybe updating packages was the answer all along!

  • David

    Organizer
    December 4, 2020 at 9:56 am

    Ok, great! I still have a few thoughts for you that we can discuss in a few minutes if you’re still able to join.

Viewing 1 - 8 of 8 posts

Log in to reply.

Original Post
0 of 0 posts June 2018
Now