Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What good resources are there for R idioms, in the same line as there are for Java and Python?
I would primarily recommend the R Inferno. In particular, study section 3 on vectorization, which is probably the key concept in R programming.
Beyond that, I would second Dirk's recommendation of John Chambers book.
Going a step farther: the R language is derived primarily from Scheme. One of the best ways to deeply understand R programming (as compared to a language like Java or C) is by learning about functional programming. For this, the best resource might be SICP (the "Structure and Interpretation of Computer Programs", available free online) which uses Scheme. You can find the relevant video lectures online as well: MIT 6.001 and Berkeley 61a.
There is Rosetta Code which presents many common programming tasks in different programming languages. Then there is a blog post by Stephen Turner that lists several ressources for programmers coming from other languages, for instance you can find slides from Drew Conway who compares Python with R.
Easy: 2200+ packages and counting on CRAN :)
Actually, jokes aside, the best description I have read was in Chambers (2008).
This is a very interesting question -- R is indeed full of idioms, and the situation is made even more difficult by the fact that there are many idioms for data analysis, in addition to the more general programming ones. Combined with R's expressiveness and its penchant for violating the principle of least surprise, this often makes the learning curve a bit steeper than one would like.
Personally, I picked up most of what I know by reading help, reading various tutorials and tip collections, and occasionally looking at source code of built-in functions. R FAQ has useful tidbits to start with. Revolution Computing has links to good resources, particularly for programmers. Also, I found Howard Seltman's collection of tips and links to be useful; I would bet that links on that page would cover most useful R idioms, but I am curious to see what else is out there.
This may or may not help you on your quest to figuring out R. But back when I was getting accustomed to R, I found that matlab to R dictionaries helped quite a bit (i.e. assuming you know how to use matlab). I can't seem to find the one I used, but found this one, which seems to illustrate things nicely.
Nowadays, I'd say the most definite resource on all details of the R language is Hadley Wickham's book.
Reading this, you'll get a very thorough understanding of how R works.
The book covers - among many other things - functional and object-oriented approaches to programming in R. Other chapters are devoted to the basic data structures and to performance issues in R.
Note that this really is a published, high-quality book that is freely accessible online.
There is also Rchaeology: Idioms of R Programming by Paul E. Johnson, which is one of the vignettes for the rockchalk package.
He says 'it includes "deep insights" and programming advice that reflects the customs and mannerisms of the R leaders.'
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm an intermediately experienced R user, with a team of R developers.
However, I find that when our programs starts growing, it becomes very hard to manage and debug, and work as a team.
I am a C++ / Java / Python user, and though this seems most similar to Python of those three, I still find it hard to deduce from known Java and Python "Best Practices" unto R.
Looking for a book or tutorial discussing coding conventions, and R software engineering principles, maybe OOP stuff?
UPDATE:
There are two more recent books that you definitely need to check out when writing packages:
Advanced R from Hadley Wickham, explaining about environments and other advanced topics.
R Packages from Hadley Wickham, giving a great guide for package writing
There isn't one book or style guide for writing R packages; there are numerous books about R that include package writing etc, and the R internals give you a style guide as well.
R coding standards from R internals
The books that contain the most advanced information about R as a programming language are in my view the following two:
R programming for bioinformatics from Robert Gentleman
Software for data analysis: Programming with R from John Chambers
Both books give a lot of insight in R itself and contain useful style tips. Gentleman focuses on object oriented programming (as Bioconductor is largely S4 based), and Chambers is difficult to read but a rich information mine.
Next to that, you have a lot of information on stackoverflow to get ideas:
Coding practice in R : what are the advantages and disadvantages of different styles?
Function commenting conventions in R
any R style guide / checker?
What is your preferred style for naming variables in R?
Common R idioms
But basically you'll have to sit down with your team and agree on a standard. There's no 'best' way, so you all just have to agree on a good way you all use in order to keep the code consistent.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm looking for sites with examples and tutorials for OpenGL. The OpenGL SuperBible seemed to be a must-have so I just got it and it seems a bit too complicated for me at the moment due to my lack of math knowledge. Therefore, I have decided to start out with simple 2D-games which shouldn't be that hard. The tutorials and examples need to be up-to-date which seems hard to find. I'd love a very simple 2D game example like Pong or similar that I could build upon.
Also: what math is necessary for 3D-programming? Would it be possible for me to learn most of it by myself or do I have to wait for college/late high school?
And of course there's Nicol Bolas' site which is much nicer and more up to date than NeHe and the typical sites that deal with 10-15 year old OpenGL.
As mentioned in other posts, NeHe is great. It is getting a bit old though. Lighthouse 3D is pretty helpful as well. For the most up-to-date references, just go straight to OpenGL. It's a great resource. Real-Time Rendering is a great book for computer graphics. The website has tons of resources as well.
Regarding the math that you should know, linear algebra is a must in computer graphics. Many computer graphics books will provide an overview of the math that you should be familiar with. The book I mentioned above (Real-Time Rendering) provides a great overview. Another decent book relating to the math required for computer graphics is Fundamentals of Computer Graphics. There may be better books out there in terms of the math overview that you're looking for, but I've found these two to be helpful. Be aware, though, that neither of these books will have a lot of examples; they cover some of the more theoretical aspects of computer graphics.
I would recommend having a look at Joe's Blog as well.
For math, have a look at this book.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'd like to know if there exists a spreadsheet application which uses an existing functional-programming language to define functions.
I've already heard about Resolver One which uses python, but I'm more interested in anything which uses a purely functional language like Haskell.
Thanks
Spreadsheets are quite a popular application among functional programmers. They have been a recurring theme in papers over the years. Some of the more memorable papers include
Spreadsheet Functional Programming by David Wakeling (2007).
Forms/3 by Margaret Burnett and many others (2001)
Implementing Function Spreadsheets by Peter Sestoft (2008)
You can also read about an effort to make Excel more functional.
For each of these papers I have either read the paper or heard a talk based on the papers. None of the papers is fabulous but all of them are good. I think the one with the most interesting ideas is by Sestoft—and his experimental results are pretty amazing.
If you count JavaScript as a functional programming language you can use Google Web Scripts for Google Spreadsheets :)
There's Scheme In A Grid (http://siag.nu/siag/), but it's looking kind of out of date.
There's also Haxcel (http://www.mrtc.mdh.se/projects/Haxcel/), which was a thesis project.
If you want to do functional programming in a spreadsheet the best practical choice is probably Resolver One, as you've already noted. (I would say "functional programming" in this context means first-class functions that work with other spreadsheet functions and the sheet itself - i.e. you could write a function that returns a function, call it and have the result go in a cell for yet other cells to call, etc. I don't know if OpenOffice and Google Docs will do that.)
A colleague and I have been working on a little project to do this within Excel, using a syntax very close to Excel formulas. I described it briefly in a comment on Roy MacLeans's VBA Blog:
http://roymacleanvba.wordpress.com/2009/08/04/domain-specific-languages-%e2%80%93-part-2/#comment-130
It's changed some since I posted that, but if you want to call our very-minimal syntax a "language", it's certainly "pure". (And I'm still planning to release it to the vast universe of FP-implemented-in-VBA enthusiasts, but stuff keeps coming up...)
There is herculus.io
But it seems down currently.
The guide describes a concept I find very interesting: https://app.herculus.io/doc/guides/app/
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm working with a small team of analysts and statisticians on what will be a medium-sized body of R code. They're smart people, but they're not trained or experienced as programmers, per se. (I am.) They've written some R code, but for our project to be expandable, efficient, and maintainable, it needs to become well-structured, and rather more piratical. One of the better way to learn to be a better programmer is to study elegant existing code. Can anyone suggest some open source examples of R code (on CRAN or wherever) that you think are particularly clear, literate, and good examples? Functional is good, S3 objects are OK, deep magic is bad.
My two favorite packages can both be browsed on R-Forge and are very well documented (although they may be too big for an introduction):
The caret homepage and source code.
The zelig homepage and and source code.
I think that the Google style guide does a great job of capturing the style of the Core team, although Hadley has his own style guide which can be read if you're looking at his packages. You can browse Hadley's packages on Github (and his homepage is full of useful content), in particular:
plyr
ggplot2
reshape
This article on the R-Wiki is also a good read for seeing ways to optimize code.
Not strictly related, but make sure you get them used to using Source Control (perforce, subversion, git, rcs, etc) as quickly as possible. That reduces the learning pains.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I've been reading about Ocaml's consistent speed, rapid prototyping ability, and excellent memory management, and decided to take it up.
As I've already got Ruby, *lisp, Haskell, and Erlang under my belt, I'm interested specifically in what KISS-violating features I should look out for in Ocaml.
If you've started Ocaml with a background in the above languages, what was the most frustrating thing to grok? How did you get around this difficulty? What analogies helped you get into the flow of the language?
I'd also be interested in knowing whether you have done more than simply learn Ocaml, and have actually converted to it for a large percentage of your coding problems.
I found an excellent resource on Ocaml and its relation to most other languages: http://www.soton.ac.uk/~fangohr/software/ocamltutorial/lecture1.html
Not only does it explain the why, it also explains many of the little quirks likely to snag you as you begin.
Ah, I found a cheatsheet highlighting almost all of its syntactic weirdnesses.
I have heard the APress Practical OCaml is awful as well.
Introduction to Objective Caml is excellent and specifically addresses a few anti-KISS gotchas, such as ways the type-system can be unforgiving.
Coming to OCaml from a C++ background, I found replacing classes with variant types to be the hardest transition (and it was easy!).
There is a book about Ocaml "Practical Ocaml" it's not a really good book, but at least for getting started it's good enough. It's a quite practical language, which unfortunatly a "strange" syntax. If you like to see some "real" Ocaml then just look at the Shootout pages.
Regards
Friedrich