
Introducing R to a non-programmer in one hour - mcenedella
http://alyssafrazee.com/introducing-R.html
======
jebus989
Per the comments on the article I'd also advise "<-" for assignment rather
than "=", reasons (in no particular order):

1) Google says so: [http://google-
styleguide.googlecode.com/svn/trunk/Rguide.xml](http://google-
styleguide.googlecode.com/svn/trunk/Rguide.xml)

2) It's the accepted convention of the language. When she looks things up of
SO, they'll use it; if she looks at a package's source, they'll use it.

3) In RStudio it's "option+hypen" (Mac) to type the four-character " <\- ", so
no extra typing required.

4) Statistically-speaking, things like x = x + 1 makes no sense

5) You need "<<-" for the occasional global

6) 2 -> x

~~~
anaphor
Also, a language shouldn't use the same operator for declaration
(initialization in dynamic languages) and assignment imho.

~~~
alecdbrooks
Just to be clear, R doesn't ever use the same operator for both, it uses ==
for comparison like C and Python. That being said, extra differentiation is a
bonus.

------
danso
There's not much you can actually teach to someone in an hour, especially
about programming. So much of it is dependent on other computer skills...I
once taught a class for _five hours_ of introductory programming, and while
some people learned things, we were frequently caught up in things like people
saving filenames of "folder/hello.rb"...that is, the forward-slash was part of
the filename, not the path...which I didn't even know was possible on any
platform.

But what you _can_ get across, and the OP seems to have done this, is how
accessible programming can be. I don't know about RStudio, but jumping into a
REPL is easy enough in any modern languages, as is running a script. We take
it for granted, but very very few people who haven't programmed realize that a
"program" is simply composed of text. Hell. most people don't understand that
about web pages.

So even if you won't teach much in an hour, overcoming that intimidation
factor of "where/how do I even start?" is still pretty huge.

~~~
minimaxir
RStudio is the best IDE I've ever used and I wish something like that existed
for other programming languages. The default workspace is split into the
script, data, terminal, and meta (files/charts/help), and selecting a data
frame variable will display it in a formatted window, making it very, very
easy to debug data issues (I'm attempting to switch from R to Python/pandas
due to performance/package issues, and I'm having much more difficulty
debugging code.)

~~~
catinsocks
Check out Spyder if you are doing Science stuff with python:
[https://code.google.com/p/spyderlib/](https://code.google.com/p/spyderlib/)

~~~
minimaxir
Actually, that looks right up my alley. Thanks!

------
craigching
Nice, brief, introduction to R. If I might be so bold, I might suggest taking
the Coursera "Computing for Data Analyis" class. It's only 4 weeks long and
the first lesson covers everything in this blog post and more (I'm actually
taking this class now). Though the first class is a bit longer than one hour
(but not by much!).

------
VLM
As an intro, its well written and documented.

If there is a fail, his sister is a senior in sociology and she "must have"
already done significant statistical analysis in class... right? At the very
least did some averages using her calculator in high school or something? So
there should be substantial opportunity for compare/contrast, assuming his
sister is compatible with this learning technique and the author knows
anything about what the sister already knows. That would make a remarkably
awful non-specific general population introduction.

Also some focus on what she's doing... I did not find generic screwing around
with R to be particularly challenging, I found "how do I connect R to my
enormous database cluster in an intelligent fast simple way" to be a huge
problem when starting out. OK I can average and std dev five hand entered
numbers, that's very easy, now how about a complicated multi-site relational
database with 1M records? She may have a totally different challenge, like all
her raw data is CSV format or something.

R is fun once you climb that vertical learning curve wall at the start and
generate your first live result. The learning curve is very easy after that
first result.

~~~
vcrash
The author of this piece is a woman.

~~~
VLM
Luckily it doesn't change my response in any way other than in addition to all
the "he" translating to "the author" all the "she" should refer to "the
author's sister". I'm a "he" who provided software support to my sister, so
you can see the likely source of that assumption. No negative implication of
her ability to successfully portray her chosen gender role intended.

Also I think its lame to check out bylines to make sure I run stuff thru the
right sexism filter; I clearly stated its a "good" article; not "good, for a
girl" article, or "not up to the manly standards of excellence" article.

~~~
Fomite
It's not a byline. It's the name of the website, the name of the window when
opened in Safari, it's _got her picture right next to the text_.

You might not have belittled her because she's a woman, but simply assuming
"Programming article = male by default" is in and of itself harmful.

------
thrownaway2424
In my experience, non-programmers are the only people who can grok R in the
first hour.

~~~
Crito
I'm not so sure. A few years ago in university I took a stats course (offered
by the maths department) that had twice-weekly mandatory labs where we learned
and used R. Most people in the course were not programmers at all, and I ended
up helping people most of the time during the course.

R is really weird, but non-programmers are typically unaccustomed to precisely
typing non-english into a computer. They aren't trained to quickly spot syntax
errors or grok error messages.

------
dangoldin
Nice post. I've recently been trying to get back into R with the goal of being
able to replace Excel. For the basic stuff R is great but as you start doing
more complicated things it takes quite a while to figure out to do them in R.
This is a part of the learning curve.

~~~
dded
I really like Excel for adding up columns of numbers. Any task where you want
to see the data (and the quantity of data is low enough to realistically be
seen) and the operations performed on the data are relatively simple and
straight-forward.

But once the operations start getting more involved, I really start disliking
Excel (or any spreadsheet). Excel shows the data but hides the formulas. At
this point, I very much prefer a script.

~~~
dangoldin
Something I've been thinking about is an Excel frontend with an R backend.
Each worksheet becomes a data frame so you can edit it in Excel and quickly
apply some formula but you can also jump into an R console to do something
more complicated.

~~~
jofer
Have a look at DataNitro for a similar idea with python as the backend:
[https://datanitro.com/](https://datanitro.com/)

I've never used it, but it looks quite nifty.

It would certainly be interesting to see something similar for R.

