Hi Nick,
Hooray some questions.
1. To solve a systems of equations have a look at solve(), or better
qr.solve() or chol2inv() depending on how much structure you have for
your matrix.
2. You need to download the sources from CRAN.
E.g.: http://cran.ms.unimelb.edu.au/src/base/R-2/R-2.5.1.tar.gz
3. Have a look at ?Startup
Cheers
Rob
--- In sportsci_rtutorial@yahoogroups.com, "Nick
Flyger" <nickflyger@...> wrote:
>
> Hi again,
>
> I had some questions to pose to Rob/group...
>
> Is there a similar function in R to the backslash operator on
matrices --
> "\" or "mldivide()" -- in Matlab? Essentially it will try to solve
the
> simultaneous equation Ax=B for x by x=A\B in the least squares
sense. I am
> looking for a way to calculate the DLT coefficients in a 3D study.
>
> If R is open source and (if I understand correctly) it is possible
to view
> the alogarithms, how does one view that source code? For example, I
want to
> view how the F ratio is computed by aov(), can I view that code
somewhere?
>
> Finally if I want certain scripts to run on start up how do I go
about that?
> For example, set the working directory to something other than the
default
> "C:/Program Files/R/R-2.5.0/bin"
>
> Cheers
> --
> Nick Flyger
>
> Senior Biomechanist
> Centre for Biomechanics,
> Institut Sukan Negara Malaysia,
> Komplex Sukan Negara,
> Bukit Jalil, Sri Petaling
> PO Box 10440, 50174 Kuala Lumpur,
> MALAYSIA
>
I have been playing with R a lot in the last few weeks and I am completely sold on it. However trying to sell it to others here is hard because they are stuck in SPSS mode and afraid of the steep initial learning curve with script based editing. Basically I need to teach them statistics and programming in one hit, which is difficult to say the least, worse so when I am learning the language at the same time.
So after surfing the web for a while I came across R Commander (http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
). It is a simple GUI that has non-threatening menus similar to SPSS. R Commander provides most basic statistical and graphing methods under the menus and can easily import most common data formats from the menus. It is available on Win, Mac (may be buggy) and Linux (tested on red hat).
Now I know that to have complete control of analysis, scripting is best but this GUI can soften the introduction because it also provides a scripting window that displays the commands that the GUI sends to R, and then outputs to the R-console screen. Basically students, first time users etc... can see the code required to run simple tests and graph results. I use it in the same manner as the macro recorder in Excel. I run something and then study the code and adapt it to more complex scripts I am writing.
There are less options to run 'advanced models' but they can easily be added by advanced users by creating new menu items and linking them to scripts. Although I guess anyone who is at that advanced level can probably do the analysis purely through scripting and realizes the limits of SPSS etc... i.e. you are limited by how much you can customize the analysis (hence we use R).
Anyone who wants to install the program can type...
> install.packages("Rcmdr", dependencies=TRUE)
...directly into the R Console. I found that some CRAN mirrors do not seem to have all packages (strange?) but Australia (QLD) seems to do pretty good.
In summary anyone who gets put off by the steep learning curve of R and is coming from a SPSS, Statistica etc... background may want to give this a crack. It could also be a good first intro to R for students. The author seems very approachable too and is keen to hear about users experiences. The link above includes zip files for direct loading (but does not contain the dependencies i.e. other packages it needs to install to allow certain features) and a PDF of a journal article written about the software.
Hope that helps people. -- Nick Flyger
Senior Biomechanist Centre for Biomechanics,
Institut Sukan Negara Malaysia, Komplex Sukan Negara, Bukit Jalil, Sri Petaling PO Box 10440, 50174 Kuala Lumpur, MALAYSIA
Is there a similar function in R to the backslash operator on matrices -- "\" or "mldivide()" -- in Matlab? Essentially it will try to solve the simultaneous equation Ax=B for x by x=A\B in the least squares sense. I am looking for a way to calculate the DLT coefficients in a 3D study.
If R is open source and (if I understand correctly) it is possible to view the alogarithms, how does one view that source code? For example, I want to view how the F ratio is computed by aov(), can I view that code somewhere?
Finally if I want certain scripts to run on start up how do I go about that? For example, set the working directory to something other than the default "C:/Program Files/R/R-2.5.0/bin"
Cheers -- Nick Flyger
Senior Biomechanist Centre for Biomechanics, Institut Sukan Negara Malaysia, Komplex Sukan Negara, Bukit Jalil, Sri Petaling PO Box 10440, 50174 Kuala Lumpur, MALAYSIA
--- In sportsci_rtutorial@yahoogroups.com, "Ian
Shrier" <ian.shrier@...> wrote:
>
> Rob
>
> I am going through the tutorial #12. You used the term "x%%2" and
said it is
> even numbers divided by modulo 2 have no remainder. Sorry for my
ignorance,
> but what is "modulo", and have you talked about "%%" before?
>
> Ian
>
Hi Ian,
Good point. I introduced the modulo operator at the beginning of
Session 5. Probably should have explained what a modulo operator is
though.
Wikipedia definition:
The modulo operation finds the remainder of division of one number by
another. Given two numbers, a (the dividend) and n (the divisor), a
modulo n (abbreviated as a mod n) is the remainder, on division of a
by n.
The first number is divided by the second using integer division,
meaning no decimal places are allowed. For instance, the expression
"7 mod 3" would evaluate to 1: Two times 3 equals 6 with a remainder
of 1: 7 = 2*3 + 1
or
"18 mod 4" evaluates to 2: 18 = 4*4 + 2
Since the definition of an even number is that you can divide it by
2, all even numbers will have a reminder of 0. In R, the operator for
modulos operation is %%, which results in the expression "x%%2".
Hope that explains it.
Cheers
Rob
Rob
I am going through the tutorial #12. You used the term "x%%2" and said it is
even numbers divided by modulo 2 have no remainder. Sorry for my ignorance,
but what is "modulo", and have you talked about "%%" before?
Ian
Sorry guys,
Took me a while to upload a new session since I just moved back to
Germany. With regards to that biker post, I changed the group
settings. Now only members can post a message. If that's not enough
than I guess we have to switch to the moderated thing.
Cheers
Rob
Hello,
This email message is a notification to let you know that
a file has been uploaded to the Files area of the sportsci_rtutorial
group.
File : /tinnR.doc
Uploaded by : gerrobrein <gerrobrein@...>
Description : Add on session describing how to install the Tinn-R editor and
to link it up with R.
You can access this file at the URL:
http://groups.yahoo.com/group/sportsci_rtutorial/files/tinnR.doc
To learn more about file sharing for your group, please visit:
http://help.yahoo.com/help/us/groups/files
Regards,
gerrobrein <gerrobrein@...>
Hi Ian,
ESS is based on the Emacs editor and enables Emacs to link up with R.
In the Unix/Linux world, Emacs is kind of the standard editor and
goes way back. Unfortunately, as I was raised on Windows system I
never really got into using it. Although a Windows port is available.
Emacs has all sorts of nice features and is programmable. This way
you can use it as an all-purpose editor and link it to all sorts of
tool chains. For example if you code stuff in C/C++/Java/etc Emacs
can control the compiler/debugger, or if you write Latex documents
you can generate you output files from Emacs. Actually, I probably
should make the effort and get used to it at some stage. Concerning
Miktex, which is the open source port of the Latex system for
windows. In the natural sciences (Maths, physics, …) Latex is the
typesetting system of choice. Especially, as soon as you have many
equations in your document there really is no alternative to Latex.
What does it mean to write a document with Latex? Basically, you
write your document in your favorite editor as a plain text document.
All formatting is done explicitly similar to HTML (although a front-
end exists: LyX). Once the document is written it is very easy to
change styles and use either common styles or you define your own.
For example, our University of Otago provides a Latex thesis document
template, which defines all necessary styles. Same for Biological
Cybernetics. I have written my masters thesis in Latex and once you
are familiar with the commands, it is actually no problem at all.
What you gain is, that the document generated by Latex looks so much
better compared to MS Word, which neglects 500 years of typesetting.
Further, as all you are writing is a plain text file you do not run
into problems with Word97 vs. Word2007 document versions or similar
problems. You can generate got looking HTML code out of Latex and
probably all sorts of other things I am not aware of. Latex comes
also with an advanced bibliography tool (APA no problem). Again,
everything at no cost! However, I would not recommend for people to
start using Latex only when writing their thesis as you need a bit of
time to get familiar with it. Nevertheless, if you have a bit of time
on your hand and on urgent document it is definitively worth having a
look at it.
Concerning Tinn-R, which is the editor I use when, working with R. I
just happened to put together a little add-on session, which
describes how to install Tinn-R and how to link it up with R on
Windows. I tried to document every necessary step as thorough so you
basically only need to follow the document and it should work.
--- In sportsci_rtutorial@yahoogroups.com, "Ian
Shrier" <ian.shrier@...> wrote:
>
> Rob
>
> I was checking out your links. A couple of questions:
>
> what is ESS used for?
>
> Is Mike-Tex supposed to be an alternative to using Word or
WordPerfect, or
> an alternative to something like Illustrator/Corel Draw?
>
> Will you later be showing how to use Tinn-R in connection with R?
I use
> Crimson Editor now as my text editor, and it works great for many
programs
> but it looks like Tinn-R is linked to R and that would be helpful
(I have
> downloaded it but don't have the time to figure it out now). For
now, I'll
> stick with the regular Rgui.
>
> I also downloaded the OpenOffice program. I have some friends who
have been
> trying to get me to use it and your link just pushed me over the
edge...
>
>
> Ian
>
Rob
I was checking out your links. A couple of questions:
what is ESS used for?
Is Mike-Tex supposed to be an alternative to using Word or WordPerfect, or
an alternative to something like Illustrator/Corel Draw?
Will you later be showing how to use Tinn-R in connection with R? I use
Crimson Editor now as my text editor, and it works great for many programs
but it looks like Tinn-R is linked to R and that would be helpful (I have
downloaded it but don't have the time to figure it out now). For now, I'll
stick with the regular Rgui.
I also downloaded the OpenOffice program. I have some friends who have been
trying to get me to use it and your link just pushed me over the edge...
Ian
Hi guys,
I added a few links I found usefull. They either surround stats stuff
in general or the R software. The links dealing with software
packages are all based on open source implementations. What I intend
to show is, that you can build a powerfull scientific computer
desktop solely relying on open source software.
I'll try to add every now and then extra documents which will show
how to interface R with these packages.
Happy pRogramming
Apparently there's some confusion about what to do with this group.
I put a file into the group directory called session_1.doc which
contains the first tutorial.
In order to access the file you have to sign in with the group, which
shouldn't be a problem once you have a Yahoo ID.
If you have any questions please just post a message since you
probably won't be the only one.
Cheers
Rob
Hi everybody,
This group aims at providing a basic introduction to the R stats
package (www.r-project.org).
At the moment the tutorials are set up so that each session can be
covered in about 10min and hopefully new sessions will be released at
least twice per week.
Anyway, all of this is really preliminary and will hopefully be
subject to discussion and accordingly may change in the future.
Cheers
Robert