Skip to main content

Getting Started with R

The easy way to get started with R is to use RStudio. You will need to install both R and RStudio. Here are the software packages you need to install:

Windows
Mac OSX
You will need access to the internet to download R packages. If you need to configure a proxy, in RStudio, you will need to edit the environment text file:

file.edit('~/.Rprofile')

In that file, you will need to add the following settings:

Mac OSX:

Sys.setenv(http_proxy="http://proxy:8080")


Windows:

http_proxy=http://proxy:8080

Instructions were based from the following articles:

Once you have set up internet access, you should be able to install R packages. The yhat blog lists 10 R packages they wish they'd known about earlier.
  • sqldf (for selecting from data frames using SQL)
  • forecast (for easy forecasting of time series)
  • plyr (data aggregation)
  • stringr (string manipulation)
  • Database connection packages RPostgreSQL, RMYSQL, RMongo, RODBC, RSQLite
  • lubridate (time and date manipulation)
  • ggplot2 (data visulization)
  • qcc (statistical quality control and QC charts)
  • reshape2 (data restructuring)
  • randomForest (random forest predictive models)

Comments

Popular posts from this blog

iReport Default Date Parameter

If you want to set a default date for a jasperreports parameter, you can enter the following in the default value expression of the parameter. new Date() However, if you wanted the default to be relative from today, for example, 3 days ago, you will need to do go outside of the standard java date libraries (Date, Calendar) because JR parameter does not allow you to have multiple statements. You can write your own utility package or you can use Joda , a replacement library for the JDK date and time library. To use Joda in iReports, you need to extract the jar file and add it to Options -> Classpath. You may also drop the jar file in iReports' lib directory. You will also need to add this library to your application or report server. For setting a default date 5 days prior from today, use this: new org.joda.time.DateTime().minusDays(5).toDate() or this if you want the time part set to the beginning of the day: new org.joda.time.LocalDate().toDateTimeAtStartOfDay().minusDays(5).to...

Your car key remote got wet, what now?

My car key fell into a street drain where it lay there for at least 5 minutes before somebody was able to fish it out. The first thing you need to do is remove the battery and dry out the electronic parts. I used tissue paper to blot out all visible moisture. When everything appeared to be dry, assembled the key back and tried to open the car. Fortunately, it worked. A couple of hours later, it didn't work anymore. When I checked the battery again, there was a little water and it appeared that there was still moisture inside the casing. The best thing to do here is to find silica gel or a dessicant which you can find inside new shoes or bags. If you can't find any, you can go to a supermarket and buy a pack of rice crackers. I knew One One Rice Crackers had a large pack of dessicant inside. That's the one on the left below. I found the one on the right from a Case Logic bag. Just pack these together with the electronic component of the car key in plastic bag. Seal it and...

Activating NDD on your Globe landline

NDD and IDD is not available by default on your new Globe landline to protect you from inadvertent charges due to calls to mobile phones and long distance numbers. Note that these instructions are for Metro Manila accounts. To activate NDD, you need call 730-1000. The problem is, an Interactive Voice Response (IVR) menu greets you at that number and there is no menu option to activate NDD. There is also no easy way to get to a human in the options. For credit card companies, I always use the "Report a lost card" option to reach an agent immediately. It appears there is no such shortcut with Globe's number. After several attempts at the menus, the way I got to an agent was to pretend to customize my plan and select the option that says the information is not helpful. Here's the guide: 730-1000 IVR Menu: 1 - English 1 - Globelines 1 - Customize your plan 1 - Customize your plan 2 - Not helpful 1- Talk to a customer agent It will take about 3 minutes for the ...