Having problems with Rstudio and decision trees. First it said I can't do them from the version I have installed. I think I corrected it, and then I tried to do a very basic copy and paste to see what other surprises await. I copy/pasted the following and the output was all wrong. If it is possible to do screen share i am up for that.
I did. I am just a student, not a good coder, and R is code heavy in my opinion.That said if my answers or questions aren't worded properly, please be patient.
The error message though, said that it couldn't even find the titanic dataset.
That suggests, but don't prove, that the download failed. One way to check is to try again. If it fails again post the https into a browser navigation file to test the connection.
If that doesn't work, we'll have to look for some more involved explanation.
Errors give information.
When seeking help to understand an error, it's good practice to quote the error message, or you are asking people to guess what your problem is blind...
Come on back for questions now that you're over the getting started hump.
Here's a short backgrounder on a helpful way to think about R
One of the hard things to get used to in R is the concept that everything is an object that has properties. Some objects have properties that allow them to operate on other objects to produce new objects. Those are functions.
Think of R as school algebra writ large: f(x) = y, where the objects are f, a function, x, an object (and there may be several) termed the argument and y is an object termed a value, which can be as simple as a single number (aka an atomic vector) or a very packed object with a multitude of data and labels.
And, because functions are also objects, they can be arguments to other functions, like the old g(f(x)) = y. (Trivia, this is called being a first class object.)
Although there are function objects in R that operate like control statements in imperative/procedural language, they are best used "under the hood." As it presents to users interactively, R is a functional programming language. Instead of saying
take this, take that, do this, then do that, then if the result is this one thing, do this other thing, but if not do something else and give me the answer
in the style of most common programming languages, R allows the user to say
use this function to take this argument and turn it into the value I want for a result
I kept after it, and kept getting error messages. I went back to a python trick- check after each line to see if it works, and got this :
Take a look at this error message...
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'UniversalBank.csv': No such file or directory
I thought it might be important. I know in SAS, when I am working on that platform I have to be able to see the file as a library, or it won't work.
Great. Please markyour answer as the solution for the benefit of those to follow. (No false modesty; it closes the loop in the simplest possible term and serves as a user-to-user alert: make sure the file is in your current working directory.
I should have mentioned the easy way to check
dir()
(if it doesn't show up then the R session can't see it without a path, such as data/file.csv for a subdirectory in the working directory, or a full pathname outside.)
Do you know of anyone who can to a screenshare to make sure the system is even set up properly ? I need to use the tools to do regression analysis for my class, and I have gotten a connection error message and then this one:
Thanks for taking the tease in good spirit. R and much other open source software runs on *nix, and even among flavors of *nix, prominently macOS, but even some Linux derivates, there are platform differences that can give rise to difficulties.
Re-installation won't fix the error message. It means that "rt" does not exist in the working directory, which is easily checked with dir() or, if it a remote file with a browser. It may indicate network congestion that times out the attempt to open. There's a lot of that these days with much higher streaming. If, however, the error returns immediately it's very likely that the file doesn't exist at all or needs a full path name.