learnr | Interactive Tutorials with R Markdown | Data Visualization library

 by   rstudio R Version: v0.11.4 License: Apache-2.0

kandi X-RAY | learnr Summary

kandi X-RAY | learnr Summary

learnr is a R library typically used in Analytics, Data Visualization applications. learnr has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

The learnr package makes it easy to turn any R Markdown document into an interactive tutorial. Tutorials consist of content along with interactive components for checking and reinforcing understanding. Tutorials can include any or all of the following:. Tutorials automatically preserve work done within them, so if a user works on a few exercises or questions and returns to the tutorial later they can pick up right where they left off. Learn more about the learnr package and try example tutorials online at
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              learnr has a low active ecosystem.
              It has 616 star(s) with 236 fork(s). There are 32 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 133 open issues and 291 have been closed. On average issues are closed in 92 days. There are 11 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of learnr is v0.11.4

            kandi-Quality Quality

              learnr has 0 bugs and 0 code smells.

            kandi-Security Security

              learnr has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              learnr code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              learnr is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              learnr releases are available to install and integrate.
              learnr saves you 7349 person hours of effort in developing the same functionality from scratch.
              It has 15186 lines of code, 0 functions and 36 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of learnr
            Get all kandi verified functions for this library.

            learnr Key Features

            No Key Features are available at this moment for learnr.

            learnr Examples and Code Snippets

            No Code Snippets are available at this moment for learnr.

            Community Discussions

            QUESTION

            How to render multiple `quiz` objects in one chunk using a loop in markdown?
            Asked 2021-May-10 at 12:33

            I would like to render multiple objects of the function quiz of the library learnr using a loop in one chunk. The R is compiling the html-markdownfile without problems, but the rendering is not correct. It is rendering text and not a question as it is supposed to.

            This is my reproducible code, currently not rendering correctly:

            ...

            ANSWER

            Answered 2021-May-10 at 12:33

            I found a solution, It turns out that in one chunk it is not possible to render two or more functions quiz.

            My solution is to generate multiple question_text in a loop, store them in a list and then use eval to call all the questions as arguments of quiz. This is the solution:

            Source https://stackoverflow.com/questions/67448540

            QUESTION

            Using R/Markdown fails inside learnr question
            Asked 2021-Apr-14 at 21:10

            Motivation: I want to write an interface that uses questions from the R package exams in learnr questions/quizzes. In R/exams each question is either an R/Markdown (Rmd) or R/LaTeX (Rnw) file with a certain structure specifying question, solution, and further meta-information. The questions can contain R code to make them dynamic, e.g., sampling numbers or certain text building blocks etc. Hence, the workflow is that first the questions are run through knitr::knit or utils::Sweave and then embedded in a suitable output format.

            Problem: When I rmarkdown::run("learnr+rexams.Rmd") a learnr tutorial that dynamically produces a question or quiz from an Rmd exercise I get the error:

            Error in if (grepl(not_valid_char_regex, label)) { : argument is of length zero

            The code for a simple reproducible example learnr+rexams.Rmd is included below. The reason for the error appears to be that learnr runs a function verify_tutorial_chunk_label() that tries to assure the the learnr R chunk labels are well formatted. However, confusion is caused by the chunks that are run by the R/exams package, unnecessarily leading to the error above.

            Workarounds: I can disable the verify_tutorial_chunk_label() in the learnr namespace and then everything works well. Or I can use Rnw instead of Rmd exercises and then learnr does not conflict with Sweave(). Also, when I run my code outside of a learnr tutorial it works fine.

            Question: Can I do anything less invasive to make exams cooperate with learnr? For example, setting some appropriate knitr options or something like that?

            Example: This is the source for the minimal learnr tutorial learnr+rexams.Rmd that replicates the problem. Note that everything is very much simplified and only works for certain R/exams exercises, here using the function exercise template that ships with R/exams.

            ...

            ANSWER

            Answered 2021-Apr-14 at 21:10

            The problem is that by the time learnr::question() is called, knitr is no longer able to find the chunk label for the chunk where exams2learnr() was called. You can get around this by setting the current chunk label before calling do.call(learnr_question, x):

            Source https://stackoverflow.com/questions/67066830

            QUESTION

            How can I wrap an interactive R learnr tutorial in a package?
            Asked 2021-Mar-06 at 22:42

            I’m new to creating learnr tutorials and even more to creating packages, but after reading tutorials on these two topics, I can now create simple packages and simple learnr tutorials. Now that I know a bit about both topics, I would like to deploy my interactive tutorials in a basic package, but there are not many resources available. Can you show me how to do this in the simplest possible way?

            ...

            ANSWER

            Answered 2021-Mar-06 at 22:42

            You'll need to:

            1. Create a package
            2. Use a tutorial inside that package
            1. Create a package

            Check the chapter 2 of R Packages by Hadley Wickham. You'll understand how to start one by using:

            Source https://stackoverflow.com/questions/66511260

            QUESTION

            Set number of attempts for learnr:tutorial question before moving on to the next question?
            Asked 2020-Sep-19 at 19:46

            I am creating a homework problem with learnr:tutorial. I want to give the students 3 attempts to solve the problem before moving to the next section. I have progressive: true and allow_skip: false But at the moment, there is unlimited try again and even with the incorrect answer, the user can continue to the next question. An example of a question is:

            ...

            ANSWER

            Answered 2020-Sep-19 at 19:46

            As pointed out in comments, the option you're looking for isn't implemented in the package.
            This will perhaps be the case in up coming versions if your request is accepted.

            In the mean time, if you're ready to rebuild the package, modification to fulfill the n attempts question is quite straight forward :

            1. download learnr-master and unpack it in a directory

            2. Open learnr.Rproj under RStudio

            3. Open R/quizz.R, find shiny module : question_module_server_impl and replace it by code below.

            4. Build / Install & Restart

            5. You can now set number of retry in allow_retry argument:

            Source https://stackoverflow.com/questions/63868292

            QUESTION

            Create an open ended question with learnr:tutorial in r
            Asked 2020-Sep-17 at 15:34

            I want to allow students to input their student ID at the beginning of every quiz they take. There are no correct answers as long as they input a 7 digit number. This is what I have right now but the function does not run when the defined answers are sot one single text. How can I accept all possible entries to a question?

            ...

            ANSWER

            Answered 2020-Sep-15 at 05:52

            You could use shinyFeedback and a server chunck to input the student's ID:

            Source https://stackoverflow.com/questions/63894794

            QUESTION

            Rmarkdown import latest webcam image?
            Asked 2020-Aug-19 at 15:37

            I'm writing a learnr::tutorial markdown for my students, and would like one of the slides to show the latest image from the webcam on Palmer Station, Antarctica:

            https://www.usap.gov/videoclipsandmaps/palwebcam.cfm

            However, the field doesn't register as an image - likely because it is some sort of gallery?

            I cannot use the page link, the image adress, or the image to insert into:

            ...

            ANSWER

            Answered 2020-Aug-19 at 15:37

            QUESTION

            Pie radar chart in python (pizza slices)
            Asked 2020-Jul-17 at 09:34

            I would like to generate a pie radar / spider chart in python with 14 separate categories or "pizza slices". Something similar to this example created in excel or this example created with ggplot2.

            This plt example was useful (code below), however the observations for different categories are connected with lines rather than having their own separate sections ("pizza slices"). Any ideas how to do this is python?

            ...

            ANSWER

            Answered 2020-Jul-17 at 09:34

            In a radar chart, usually the values are one point per tick on the circular ax, connected with lines that form a zigzag pattern. A polar bar plot might be closer to the desired chart.

            A polar bar plot is similar to a usual bar plot, but bent over a circle.

            To get the bars and the labels nicely between the grid lines, the theta positions can be moved by half the bar width. And minor ticks can be used to get the grid lines back on their original position.

            For consistency, the code below also changes some calls to plt. to ax..

            Source https://stackoverflow.com/questions/62938954

            QUESTION

            Is there a way to import questions and answers from a spreadsheet into a learnr quiz?
            Asked 2020-Jul-15 at 18:39

            I am new to R so thank you in advance for your patience.

            I would like to create a multiple choice quiz in R using the learnr package (the quiz content is not about r code). I have all of the questions, response options, and correct answers in a spreadsheet. Since my item bank has over 100 items, I will give a simpler example

            ...

            ANSWER

            Answered 2020-Jul-15 at 18:39

            You can simply loop over the rows of your data or spreadsheet and use a function to set up the questions and save them in a list. My approach uses purrr::map but you a simple for-loop we also do the trick. Try this:

            Source https://stackoverflow.com/questions/62921246

            QUESTION

            Change submit button with learnr package
            Asked 2020-May-09 at 00:14

            I am using the learnr package and I would like to know if there is an easy way to change the caption of the submit button? Instead of "Submit Answer", I would like to change it to "Validate", for example. I could not find information in the package help.

            ...

            ANSWER

            Answered 2018-Jul-10 at 15:46

            It is hardcoded, maybe make your own version of the function. Change this line quiz.R#L113:

            Source https://stackoverflow.com/questions/51268860

            QUESTION

            It is possible to store in memory code from one exercise to another in learnr?
            Asked 2020-May-08 at 20:06

            I have created a tutorial in learnr and I have noticed that for each code chunk that I create, I need to rerun the code from previous chunks if I wish to use the same data.

            For instance, if I have something like this :

            ...

            ANSWER

            Answered 2020-May-08 at 18:45

            This is a "feature" of learnr such that any exercise can be done at any time without relying on previous steps.

            The way around this is by setting up shared prepare blocks:

            Source https://stackoverflow.com/questions/61685688

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install learnr

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rstudio/learnr.git

          • CLI

            gh repo clone rstudio/learnr

          • sshUrl

            git@github.com:rstudio/learnr.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link