How to learn R as a programming language [closed] - r

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 9 years ago.
Improve this question
I'd like to know how to learn the R language as as 'programming' language as opposed to learning it as a statistical system. My question is prompted by lack of understanding of such functions as parse, eval, etc. which may not find frequent use by an R user with a 'statistics' persuasion.
Edit: I've been exploring such tools like Rpy RSPerl rJava and wish to (at the very least) be able to understand concepts that facilitate R's communication with other programming languages.
The availability of Web applications for R (R-PHP, RApache, etc.) is another motivationg factor for me to gain a deeper, more structural understanding of R.
Last but not the least, I'd like to be able to write R packages for which such understanding would be beneficial if not necessary.

For starters, you might want to look at this article by John Cook. Also make sure that you read "The R Inferno".
There are many good resources on the R homepage, but in particular, read "An Introduction to R" and "The R Language Definition".
Some very closely related stackoverflow questions:
books-for-learning-the-r-language.
what-are-some-good-books-web-resources-and-projects-for-learning-r
suggestions-on-way-resources-to-start-learning-statistical-language-r
My favorite book on the subject: "Software for Data Analysis: Programming with R", by John Chambers, the creator of the S language.
(source: springer.com)

A good book for learning R-as-a-programming-language (as opposed to R-for-statistics) is The Art of R Programming, by Norman Matloff.
It's very readable, doesn't assume you're a computer scientist, and is quite inexpensive as R books go.

I would rather suggest a good and comprehensive start, like The R Book by Michael Crawley. It's an easy-to-read and complete book on R core functions, with statistical tips and a few exercises. It focuses a lot on R strengths (e.g. linear models) and gives also useful coding tricks. It helped me a lot while I was struggling on cryptic online courses.

I'm a very hands-on learner, so this advice may be specific to my learning style. I would suggest that the best place to start "learning to program" in any language involves finding problems outside of your normal range of experience and then trying to solve them using a programming language.
The projects that taught me the most about how to program with R had nothing to do with statistics at all.
Knowing functions like parse() and eval() is by no means a measure for being "a good R programmer". Applications that require heavy use of these functions do not make up a majority of the problem space in which you can apply R. Instead, I think you should try to be "a good programmer" who knows R. This involves refining your problem-solving approaches.
Programming is not a spectator sport-- a good book is indispensable as a reference on the tools available, but you need to find some problems upon which to hone your skills.

Related

Free software for mathematical modeling. Is R a good one? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for a free software for mathematical modeling.
Here is a list of things I might be willing to achieve with this software: Integrating functions, solving differential equations, graph theory, analyzing infinite series, local stability analysis, Taylor series, get eigenvectors, compute the long term behaviour of a system of equations, etc...
Here is a related SE post. I am surprised that nobody is suggesting R. I am currently a R user and already use R for graph theory. Therefore I would appreciate to use R also to make other mathematical modeling. Is R less efficient that Sage, SimPy, Mathematica and others for mathematical modeling? Why? Do you know a manual providing exaplanation for how to make mathematical modeling with R?
Thank you
Sounds like R is your first way to go. It does not make to good sense to compare R with any other tool in such a braod way you are asking for. R packages differ largely in efficiency, some are in fact C tools while others are written in the R language. As a start R can hardly be any wrong and is free.
Matlab might be a stable alternative, Julia is rising but still pre alpha.

Is there a package in R for statistical relational learning [closed]

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
I just searched on google and r-project.org but couldn't find anything.
Is there a package in R for statistical relational learning?
Link to wikipedia:
http://en.wikipedia.org/wiki/Statistical_relational_learning
Yes, there are quite a few actually.
On CRAN, look at the gRaphical Models Task View.
Under each header is a listing of R Packages subsumed under that subject header--the first being Representation, manipulation and display of graphs.
Scroll down this page to the last three section headers:
Miscellaneous: Model search, specialized types of models etc.,
Bayesian Networks/Probabilistic expert systems; and
BUGS models, just below it.
Under these three headers are a total of 16 R Packages (seven, three and six packages, respectively). Within these nine, you should have no trouble finding a couple most suited for your project.
The only one I have personally used is bnlearn, a Package for Bayesian network structure learning. This is not my field, so I recall that the Package documentation (Manual and Vignette) are excellent and include working code examples.
Finally, for visualizing these models, I recommend highly the R bindings to the excellent Graphviz Library; the R bindings are gathered in the R Package, RGraphviz. RGraphviz is not available on CRAN but rather on Bioconductor; it depends on GraphViz.
Not yet, actually. Doug's answer is inherently misleading. If someone's looking for non-R implementation of the requested models, I may provide this link.

Linear Algebra usage in programming [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am starting to learn Linear Algebra but it is has been very mathematical and I don't know its actual usage in programming. I heard it is a very useful subject for movements(animate) and graphics. I thought I could make my learning process for linear algebra more fun if I could learn it from its application through programming. That's learn through the practical way and not just working out on paper.
Since I am still learning the very basics of linear algebra, I am thinking where and how are basic concepts of linear algebra used in programming? What kind of interesting things could be done with basic knowledge of linear algebra such as row-echelon form, LU deposition, linear combination/system, etc. Any tutorials on any languages such as Java, Actionscript, PHP or others teaching the usage of basic linear algebra concepts to create interesting simple things?
Thanks!
Matrices and their transformations are used for positioning, rotating and scaling elements in Flash, IOS and Android. Check out transformation matrix wiki, android api, and a cool flash tutorial
As you've already stated, the most likely place that you'll find it is in graphics and games programming. You don't say what language you'd like to program in, so I'll assume Java:
http://www.java3d.org/
All techniques are not created equal. You will use LU decomposition and eigenvalues more if you're doing scientific computing.
This is a very good book. Don't be fooled by the date: the mathematics haven't changed. I'd also recommend looking at OpenGL.
All the simple graphice are made with the use of linear algebra...
Make a new console project nd try your skills...
Probably the most important application of linear algebra in programming is Modular Arithmetic.
As for the examples you've provided, the relationship is quite reversed. Programming is used to implement those algorithms, the algorithms are not used for general programming.

Sources on S4 objects, methods and programming in R [closed]

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
As I'm often confronted with situations where S4 programming is needed to keep an overview, I've collected quite some sources on S4 objects, methods and programming. I've listed them here as a reference. Please add your own sources as well.
On the web
The methods help files : help files from the package methods, where much of the necessary information can be found
S4 classes in 15 pages : Short introduction on the programming with S4 objects.
How S4 methods work : more explanation about the underlying mechanisms.
Not so short introduction to S4 : with practical examples of how to construct the classes and some useful tips. It contains a handy overview as appendix, but contains errors as well. Care should be taken using this one.
OOP in R : handout notes with practical examples on S3 and S4
S4 Objects : presentation by Thomas Lumley about S4 objects.
R object oriented programming : in-depth introduction to object oriented programming in R. It covers S3, S4 and S4 reference classes. The accompanying sequences package implements the class system used throughout the slides.
Books
Software for Data Analysis-Programming with R (J. Chambers) : A classic, although not reviewed positive everywhere, that contains a large section on S4
R programming for Bioinformatics (R. Gentleman) : specifically directed towards working with Bioconductor, which is completely based on S4. But it gives a broad overview and is useful for many other people too.
PS : if somebody finds the community checkbox, you can make this a community-owned post. Somehow I can't find it in the edit window any more...
My write up of S4 (still in progress) is available here: http://adv-r.had.co.nz/S4.html
R for programmers (Matloff) (free) and Introduction to scientific programming and simulation (Jones) have a short section on "new-style" S4 classes.
Another good book by John Chambers: "Programming with Data: A Guide to the S Language". As the name suggests it is actually about S, not R, but it provides a lot of valuable information about S4 classes anyway.
There's also some information in the R manuals "Writing R Extensions" and "R Internals" (particularly the latter). Those can be found at http://cran.r-project.org/doc/manuals/.
Finally, I would recommend "How S4 Methods Work", which is a great overview of how to think about S4 as it fits into R.

Vector Education [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Does anyone know where I could get a rundown of the vector math I'd need in order to program a raytracer? I could use a refresher of linear algebra and multivar calc since it's been a few years since I've taken those classes.
Good linear algebra books are terse at best, and would probably be overkill. A good 3D programming textbook might be more to the point. They'll have enough theory to get you through the math, and enough application to get you through the code.
There are plenty of free, online courses around. Some are specifically for 3D graphics programming. You might also take a look at NeHe's OpenGL tutorials.
If your brave, you could even look through the POV-Ray source.
Good luck.
Linear algebra is wonderful, and certainly appropriate here, but vectors in 3D space are a subset of general vector spaces.
I think something like Vector Math Tutorial for 3D Computer Graphics looks more appropriate.
i liked this book when i taught a computer graphics course: http://math.ucsd.edu/~sbuss/MathCG/
3D Computer Graphics:
A Mathematical Introduction with OpenGL
Author: Samuel R. Buss
This is the homepage for the book 3D Computer Graphics: A mathematical approach with OpenGL, by Sam Buss, Cambridge University Press, 2003. This book provides a mathematical introduction to 3D Computer Graphics at the advanced undergraduate or introductory graduate level.
* Table of contents: HTML or more complete contents as PDF. (Pagination has changed for the actual version.)
* Sample OpenGL programs
* Ray Trace software. Release 3 is now the standard version. NEW: Supports .NFF and .OBJ files. Uses kd-tree acceleration.
* Figures from the book. All figures in postscript and PDF formats.
* Errata page. List of known errata. Please email new errata to me at sbuss#ucsd.edu.

Resources