Comments (3)
Hmm, I don't see the problem in your screenshot when you just show example_df[,-2]
. In the output the 5 remaining columns seem to be shown.
The command
example_df <- example_df[,2]
indeed won't work with RTutor. Using the same variable on the left and right in an assignment is often problematic in RTutor. More precisely, problems arise if calling the command twice would yield different results than calling it only once. This restriction is hard to fix in RTutor. So in particular deleting columns or rows won't work. If you want to do this you have to set a new variable name on the LHS.
from rtutor.
Yes you are right. Maybe something I will have a look at down the line. Right now I was able to circumvent the problem as per your suggestion.
And you are right that just showing example_df[,-2] did indeed deliver the desired output. I confused myself there.
from rtutor.
Just as a remark. Unrelated to the limitations of RTutor I also try to write my personal R code (at least the one outside packages) such that I can run a line twice without changing the result. E.g. if I want to remove a column, I like most to use a function like:
remove.cols = function(dat, cols) {
dat[,setdiff(colnames(dat), cols)]
}
which returns the same data frame even when called errorneously twice. (I don't like e.g. that select(dat, -mycol)
would throw an error if mycol
does not exist anymore in dat
). The thing is that I most often work interactively with R and it often happens that I run only some but not all data preparation steps twice and it is nice if this does not yield by accident wrong results. In this sense, RTutor forces you to follow this convention.
from rtutor.
Related Issues (20)
- Duplicated exercise names cause errors HOT 1
- Pre-run code chunks? HOT 4
- Installation issue; HOT 6
- Running example chunk HOT 5
- Test that would allow open text HOT 6
- Controlling the width of the quizzes HOT 2
- Window Position when clicking on "Go to next exercise..." HOT 2
- Executing invisible code HOT 4
- New Options regarding rtutor.app.skel HOT 4
- "Go to next exercise" Button does not trigger generation of code chunks HOT 2
- Desired behavior of check.assign HOT 1
- Width of Quizzes HOT 2
- Cutoff for Exercisename HOT 3
- Major update Branch LeverageData (mostly regarding quizzes) HOT 4
- hints based on check.call HOT 9
- highlight boxes HOT 5
- Updates in RTutor Main Branch HOT 5
- Question regarding mark_utf8 HOT 1
- Warning: Error in : colourInput() has been moved to the 'colourpicker' package. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtutor.