Monthly Archives: May 2010

The iPad: Now Available in Canada

So unless you’ve been living in a cave, you’ve probably heard about the iPad. It was released in Canada today.

I’ve had an iPad for about three weeks now; I had my parents purchase one for me when they went to the United States. I’ve had an opportunity to set it up with my American credit card as well, so, unlike some early adopters in Canada, I’ve also been able to make a few purchases for the iPad that many Canadians who have an iPad otherwise would not have.

Overall, what do I think about it?

I think it’s a pretty interesting device. I use it almost every day in much the same way that most people might use a computer for consuming information. It has in fact changed the way I do some things in my daily life because of its portability and speed.

The iPad is a very sleek device. Most people who see it are rather impressed at how thin it is and how good it looks. The screen is gorgeous and much larger than most people initially think. It’s quite bright and the colours are vivid. Unfortunately it’s also slightly heavier than most people anticipate. Thus, if you’re using it to read, you will probably want to use two hands to hold it. It’s too heavy to hold for extended periods of time in one hand.

What do I use my iPad for? Well, I primarily use it to surf the web and check my mail. I have a 16 GB Wifi iPad, so it often follows me around the house for web surfing and for email. The surfing experience on an iPad is dramatically different from surfing on a PC. The touch interface really does give you a sense of intimacy, and the double-tap on the text to zoom in on a column, or pinch-zooming on items of interest gives you a large amount of flexibility in making things readable. The device is relatively fast, too – scrolling and zooming is snappy and feels good.

A lot of people envision the iPad as something on which they can take notes on, or write on. Unfortunately, it’s really not good as a virtual piece of paper. You can’t use a stylus with a real point on it (the ones you can buy are more like broad-tipped felt markers), so the precision that you get from writing is gone. The screen itself is relatively pinpoint, but you can’t really draw on it as you might with a Wacom Tablet or a Tablet PC. I don’t think that particularly matters for me personally; if you’re sketching out quick ideas, a finger is often enough to get your main ideas across. I personally use an free app called “Draw” for idea sketching.

Writing is also one of those things that the iPad does okay at, but not necessarily well. The keyboard in landscape mode is surprisingly good, it is almost the size of a normal keyboard. However, two things limit it. First, it’s a virtual keyboard, so it has no tactile feel. You can’t tell if you’re hitting the spacebar or the 123 key on it, so as a consequence your typing slows down. Second, there are many keys that are missing (such as a row of numbers and certain punctuation). While Apple’s provided a number of shortcuts and tricks to make you type faster on the iPad (a good one is that holding down the ‘comma’ button gives you the apostrophe) they don’t make you type faster than you would on a normal keyboard. As Daniel German says, “You probably won’t be writing your thesis on the iPad”. However, in contrast, you probably won’t be using a stylus to write it out, either.

If the iPad virtual keyboard bothers you, you can buy either a Bluetooth keyboard and synchronize it to the iPad, or you can buy the iPad keyboard dock. I question the value of these solutions personally; if you’re going to connect the iPad to a keyboard then you may as well buy a netbook. They’re nice options to have, but I don’t see data entry as being one of the iPad’s strengths.

What are the strengths of this device? I use it not only for web browsing and email, but it is an excellent reader. As a researcher, I found that e-ink was not good for reading PDF files, especially the two-column files that most computer science conference proceedings appear as. I tried using an iPod Touch for reading them, but that was a chore as well, the text was much too small and the device was too difficult to scroll with to make it an effective reader.

This changes with the iPad. The scrolling is excellent and the screen is large enough to allow you to resize the PDF file to whatever size is comfortable. You can easily pan around and go back and forth through the pages. I haven’t personally experienced issues with eye strain from the LCD screen, but your mileage may vary, of course. I find one advantage of an iPad is that because it’s backlit (and bright), you can easily use it as a nighttime reader. Unfortunately it is a bit difficult to read in bright sunlight. The iPad also makes it easy to annotate. While many people I know like annotating with a pencil, I’ve found it relatively unnecessary since you can use your finger and the built-in keyboard for highlighting, circling, and commenting. If you’re looking for a PDF app for your iPad, I recommend the free app Cloudreaders, which costs nothing, allows multiple ways to transfer PDFs to your device, and works wonderfully for reading. If you want to annotate your papers, and have some money to spend, then you may want to spend the money for Aji iAnnotate.

The iPadĀ  is a wonderful entertainment device. I’ve loaded a number of music applications on it, including the Korg iElectric app, which is a virtual drum machine that allows you to export to wave files. Beatwave presents a wonderful fun way to make music, and Soundrop is an extremely simple, but wonderfully compelling application. The iPad also plays music, though I personally have not tried any streaming services. The iPad also works for movies, but I find that movies are only good if you’re on the go; if you’re at home then watching the movies on your large TV or monitor is a better experience. I hear that the iPad is a great gaming device as well but I personally have not purchased any iPad specific games.

If you’re a power user (and most of you guys reading this probably are) then you may want to consider jailbreaking your device. Spirit is available for both Mac and Windows. I recommend it because the jailbreak allows you to use the iPad for so much more than it’s been designed to do. Suddenly, you can use it as an extra drive on which to store data, or run applications in the background. You can also load your own applications on it if you’re a programmer, so you don’t have to pay Apple the $99/year if you just want to learn how to write a “Hello World” program for your iPad.

Of course, the iPad has a number of well-advertised limitations. The first is that there’s no expansion ports on it. I don’t personally see this as a problem, there’s been almost no moments when I’ve wanted to load some kind of external data onto my iPad from someone’s USB stick. The isolated iPad ecosystem makes it such that you can’t arbitrarily load movies or music on it, and you can easily get text files or other files through email on the iPad instead of through USB. I’ve heard mention of the iPad not having external memory expansion. It’s too bad that it doesn’t allow any kind of flash cards, but at the same time I haven’t really missed it either.

My primary complaint about the iPad really is the closed ecosystem, and as a consequence my worries about the device are much more ideological than functional. The $99/year developer fee is ridiculous and the restrictions that Apple puts on what apps are allowed is arbitrary; many good apps are not posted because they don’t meet some kind of invisible criteria. The device is so beautiful that if the API was expanded a bit more, there would be so much you could do with it.

Anyway, in conclusion I think that the iPad works quite well despite its limitations. I treat it primarily as a toy, but it also has a lot of work-oriented applications. I think it’s great to present data on, including diagrams and photos, and for reading information. It’s great for quick note-taking, brief idea sketching, and for playing on. If you like the idea of carrying a device that’s lightning fast and allows you to do any of the above things without any of the hassle associated with computers (handling windows, closing and opening applications, managing your applications, even waiting for applications to launch) then the iPad will meet your needs.

Running R from the command line

Much of the development and analysis work for my doctorate I do in R, which is an open-source statistics program based on the S-Plus language. Because I use R so often, there’s become a need to run the data from the command line to generate results.

One of my lingering questions has been how to script R from the command line and give it custom arguments. Here’s how you do it:

#!/usr/bin/Rscript --vanilla

args <- commandArgs(TRUE)
if (length(args) != 1) {
 print ("Usage: Rscript <script> <directory>")
 q()
}

cwd <- args[1]


Basically, the program that you run from the command line is Rscript. It came installed by default on my computer when I installed the R packages.

The first line is the shebang: #!/usr/bin/Rscript. You can specify extra command-line parameters to the Rscript command here. In this case, we use –vanilla, which means to initialize a clean environment. You can use other ones like –save, which saves the workspace at the end of the session, and –restore, which reads the previous session and restores it.

The next line is important: the commandArgs() function reads the command line arguments and stores them in a vector of strings so that you can process them. You can see that I check for arguments as well.

Finally you can address each argument using args as an array.

If you need to parse out the arguments you can try using match.arg to match individual parameters!

Type ?Rscript in the R environment to get the manual page for details.