Getting information and learning: google + wikipedia + wikibooks + wolfram alpha

When I want to find information, Google is my #1 resource. The syntax trick I use most which I learned in the research writing class (Writing 39C) at UCI is “The first word is the most important” (the first word narrows the search!). Some other tricks are “- Don’tWantThisWord” and ‘ “this quote exactly” .’ Google usually leads me to Wikipedia, an online collaborative encyclopedia, or Wikibooks, an online collection of collaborative textbooks, for my answers. These three resources are where a lot of my learning/review of statistics are found.

There is Google Knol but I don’t use it much (probably because my google search doesn’t yield these articles).

For academic articles, I search on google, but to restrict the results to just academic articles, I’ve been relying on Google Scholar.

Last but not least, Wolfram Alpha was recently released by Wolfram, the maker of Mathematica. Haven’t used it much, but it seems promising. The few reviews that I’ve read said that the search is a little tricky…you have to input the right words. Well, they’re not google afterall.

LaTeX in blogger

You can type and display LaTeX typesets in your blogs. See this, this, and this. Requirements: Firefox + Greasemonkey and the script from here.

Write LaTeX code, highlight it, and hit the LaTeX icon.

As can be seen, this doesn’t work because I am relying on the forkosh server to generate the gif image everytime it is called. Guess we are relying on his server. If you have your own server, you can install mimetex.cgi and have your server do the work. However, you have to maintain it for 24/7 uptime.

Another way is this and this (this is a very similar method). However, if this server goes down then my online LaTeX code will also be dead.

Example:

Hmmm, WordPress.com has LaTeX built in, but I’m already using Blogger. Guess I haven’t found a good, viable solution for me yet.

Sage (again): everything math

I blogged about Sage in the past and stated that I won’t be using it much since R is my language/environment of choice. This is still true, but I wanted to write a few more comments about Sage after toying with it a bit more.

Sage is based on Python (good!) and its mission statement is

Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

I like it. If I need to solve an equation, factor, do partial fraction decomposition, do Taylor expansions, find derivatives, integrate, and all else math, Sage is there for me. It’s both free (open-source) and easy to use. The learning curve is pretty low if you want to do basic things like create examples for teaching Calculus. Plotting is also great but R is superior in my opinion. Sage graphics outperforms R graphics in one respect: it can include and display LaTeX equations natively (uses matlibplot, which is based on GNU-plot, I think). Sage also displays the vertical and horizontal axes in the center of a plot, similar to the graphs in textbooks I grew up with. Sage graphics seems more geared towards teaching whereas R is geared towards professional publishing.

Personally, I’ll use Sage when I teach stuff like Calculus where I need plots with axes and all other math features that R isn’t built for.

There is a sage mode for emacs, however, is in alpha mode as of now, so the features aren’t comparable to ESS is for R.

Another great thing about Sage is it has a notebook GUI that allows it to be run inside a web browser. Therefore, you can run a Sage server that allows users run Sage interactively! See this for example. You can run notebook() on your own computer or create an account on the previous site to test it out

Scribd: embed documents in your blog/website

Want to share a document online? Whether it’s a MS Office doc (xls, doc, ppt), open office document, txt/rtf, or a pdf, Scribd allows users to upload a file and have it viewable on a website by embedding their iPaper program (Flash-based). This is cool as visitors no longer need specialized software on their computer to view the document.

I’d like to note that Scribd’s purpose is to democratize publishing, as stated on their website. I think highly of their philosophy.

Collaborations via Google Docs + Compilation of data with Google Docs Forms

Google Docs has been around for quite some time. You can view and edit word docs, spreadsheets, and presentations online. You can also view pdf files. Besides from the abilities to view and edit documents, collaboration (multiple users editing the same file) is also possible. Instead of sending files back and forth between users, we can invite collaborators via email to have access to a Google Docs file (must have google account). Then, any collaborator can edit the file and everyone else can view the changes made the file is opened (or immediately in real time if it is currently open). This is especially useful for small businesses and non-profit organizations (eg, my local church youth group).

Surveys

Have you ever wanted to send a group of people questions (eg, a survey) and have them email you back their response? After receiving the responses, you have to input the data into some master document such as a spreadsheet. The “forms” feature in Google Docs simplifies this significantly. Create a form, send the form to users, users fill out the form (either in email or by clicking a link), and all submitted information will be populated in a spreadsheet inside Google Docs. I find this very useful. For my youth group, I plan to use it for registration.

Create multiple graphics in R without multiple calls to pdf / postscript / jpeg / png

To save multiple graphics, e.g, Rplot001.pdf, Rplot002.pdf, …, Rplot050.pdf, we don’t have to call pdf() 50 times (or another graphics device function) in R. Instead, use Rplot%03d.pdf for the filename argument in pdf() and each plot() call will be saved to a new pdf file. Run dev.off() once at the end to close all devices!

Check out ?sprintf for more information about %03d and other C-style string formatting.

learn lisp for emacs, and understand how all it all works (inferior mode, etc)

NOTE TO SELF: learn lisp for emacs. I want to write my own commands in emacs, and don’t want to spend 1+hr on that ESS/Sweave tweak that I did yesterday.

rubber – latex’ing multiple times to get the final product

Rubber is a Python script that assists with the compilation of LaTeX documents. It is useful when you use bibtex for bibliographies because multiple latex and bibtex commands are needed to be executed for the document to be generated. With rubber, I can issue a single command and the necessary commands will be executed automatically:

rubber -d myfile.tex ## -d or --pdf for pdflatex


If you are making a pdf file, it will convert all eps files into pdf.

The next thing to do is to get rubber working with AucTeX and ESS/Sweave. Check out the later posts on this thread.

latex on top of graphics

lpic is a LaTeX package for typesetting on top of existing graphics.

It looks cool, but the documentation for the coordinate system needs some clarification. I will try lpic out when I have the time or when the need arises.

Good things about lpic are:

1. I don’t have to worry about fonts in graphic matching the document (e.g., computer modern font).
2. No need for post-processing on a graphic to get the font to look correctly (psfrag).
3. Font size will match that of the document.

1. Resizing the graphic will make LaTeX typesets “out-of-place.”
2. You don’t have a standalone annotated graphic. The graphic is only annotated in the final document.

UPDATE: Just tried it out, this is actually very cool! Been wanting to “WRITE on top of my graphics.” The draft option in the lpic environment assist in the placement of the typesets!

My example: Get lpic.sty from the website above. Here is the attachment (graphic). Here is the attachment (tex). Here is the attachment (final).

tables / frequencies in R

At my previous internship, SAS was the software of choice for about 80% of the statistical work done; this rate was pulled down by me using/pushing for R and another co-worker using/pushing for Python.

One of the positive features of SAS is its PROC FREQ command. It gives useful summaries for contingency tables, such as row and column summary statistics and tests of different types. R‘s base function table is not full of bells and whistles. To get similar statistics as SAS’s PROC FREQ, check out CrossTable from the gmodels package or the base function margin.table to get row/column totals. See this for examples.

Posted in R. Tagged .