Install R on Ubuntu 12

sudo gedit /etc/apt/sources.list

THEN ADD TO THE NOTEPAD FILE
deb http://cran.rstudio.com/bin/linux/ubuntu precise/

SAVE AND CLOSE

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev

RSTUDIO

sudo apt-get install libjpeg62

wget http://download1.rstudio.org/rstudio-0.98.1103-i386.deb

sudo dpkg -i rstudio-0.98.1103-i386.deb

 

 

Installing VMWare Player on Ubuntu 12

Screenshot from 2015-03-18 06:34:22Download from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0

 

uname -r

sudo apt-get install build-essential linux-headers-`uname -r`

 cd Downloads

~/Downloads$ ls -l

gksudo bash VMware-Player-6.0.5-2443746.i386.bundle

This starts the Wizard and walks you through the rest of the installation

 

Unblocking Wireless on Dell Inspiron on Ubuntu 12

Due to recent shenanigans—

To unblock all hardware

rfkill unblock all
rfkill list all

For wireless drivers

  1. Open the Terminal
  2. Install the build dependencies if you don’t have it already (but it is installed by default):sudo apt-get install build-essential
  3. Type the commands (steps 3-9): wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.18.1/backports-3.18.1-1.tar.xzHere you can get the latest ones from kernel.org site
  4. tar xvf backports-3.18.1-1.tar.xz
  5. cd backports-3.18.1-1/
  6. make defconfig-ath9k
  7. make
  8. sudo make install
    • (type your password)
  9. sudo update-initramfs-u
    • (type your password if needed)
  10. Reboot your pc. #sudo reboot
  11. Remember that after a Kernel update (sudo apt-get dist-upgrade) we have to repeat the steps 4 to 9.

Sources-

http://askubuntu.com/questions/406531/cant-reach-wi-fi-signal-on-ubuntu-but-can-do-it-on-other-os-devices-ath9k

http://askubuntu.com/questions/139036/how-do-i-fix-a-wireless-is-disabled-by-hardware-switch-error

R Website Homepage gets a facelift and looks better #rstats

What used to be this

CRAN homepage

is

now this

 

 

Yay!

Screenshot from 2015-03-17 13:23:35

Even aging websites need injections of CSS and Markdown ( which is like botox for HTML)

 

Markdown with R Commander #rstats

Just training and fiddling with spatial analytics

Markdown with R Commander

Ajay Ohri

2015-03-15

> library(maptools)
> library(raster)
> adm <- getData('GADM', country='IND', level=2)
> mahadm=adm[adm$NAME_1=="Maharashtra",]
> head(mahadm,20)
      PID ID_0 ISO NAME_0 ID_1      NAME_1 ID_2         NAME_2 NL_NAME_2                    VARNAME_2   TYPE_2 ENGTYPE_2
306 17478  105 IND  India   21 Maharashtra  306     Ahmednagar                             Ahmadnagar District  District
307 17479  105 IND  India   21 Maharashtra  307          Akola                                        District  District
308 17480  105 IND  India   21 Maharashtra  308       Amravati           Amaravati, Amraoti, Amaraoti District  District
309 17481  105 IND  India   21 Maharashtra  309     Aurangabad                                        District  District
310 17482  105 IND  India   21 Maharashtra  310       Bhandara                                        District  District
311 17483  105 IND  India   21 Maharashtra  311            Bid                     Bir|Beed|Bhir|Bidh District  District
312 17484  105 IND  India   21 Maharashtra  312        Buldana                                        District  District
313 17485  105 IND  India   21 Maharashtra  313     Chandrapur                                 Chanda District  District
314 17486  105 IND  India   21 Maharashtra  314          Dhule                  Dhulia, West Khandesh District  District
315 17487  105 IND  India   21 Maharashtra  315    Garhchiroli                                        District  District
316 17488  105 IND  India   21 Maharashtra  316        Gondiya                                        District  District
317 17489  105 IND  India   21 Maharashtra  317 Greater Bombay                                        District  District
318 17490  105 IND  India   21 Maharashtra  318        Hingoli                                        District  District
319 17491  105 IND  India   21 Maharashtra  319        Jalgaon                          East Khandesh District  District
320 17492  105 IND  India   21 Maharashtra  320          Jalna                                        District  District
321 17493  105 IND  India   21 Maharashtra  321       Kolhapur                                        District  District
322 17494  105 IND  India   21 Maharashtra  322          Latur                Kulaba, Kolaba, Kolabad District  District
323 17495  105 IND  India   21 Maharashtra  323         Nagpur                                        District  District
324 17496  105 IND  India   21 Maharashtra  324         Nanded                                 Nander District  District
325 17497  105 IND  India   21 Maharashtra  325      Nandurbar                                        District  District
> mahadm$pop=as.factor(sample(1:10,34,T))
> mahadm$pop2=as.factor(sample(1:10,34,T))
> mahadm$pop3=as.factor(sample(1:10,34,T))
> head(mahadm,20)
      PID ID_0 ISO NAME_0 ID_1      NAME_1 ID_2         NAME_2 NL_NAME_2                    VARNAME_2   TYPE_2 ENGTYPE_2
306 17478  105 IND  India   21 Maharashtra  306     Ahmednagar                             Ahmadnagar District  District
307 17479  105 IND  India   21 Maharashtra  307          Akola                                        District  District
308 17480  105 IND  India   21 Maharashtra  308       Amravati           Amaravati, Amraoti, Amaraoti District  District
309 17481  105 IND  India   21 Maharashtra  309     Aurangabad                                        District  District
310 17482  105 IND  India   21 Maharashtra  310       Bhandara                                        District  District
311 17483  105 IND  India   21 Maharashtra  311            Bid                     Bir|Beed|Bhir|Bidh District  District
312 17484  105 IND  India   21 Maharashtra  312        Buldana                                        District  District
313 17485  105 IND  India   21 Maharashtra  313     Chandrapur                                 Chanda District  District
314 17486  105 IND  India   21 Maharashtra  314          Dhule                  Dhulia, West Khandesh District  District
315 17487  105 IND  India   21 Maharashtra  315    Garhchiroli                                        District  District
316 17488  105 IND  India   21 Maharashtra  316        Gondiya                                        District  District
317 17489  105 IND  India   21 Maharashtra  317 Greater Bombay                                        District  District
318 17490  105 IND  India   21 Maharashtra  318        Hingoli                                        District  District
319 17491  105 IND  India   21 Maharashtra  319        Jalgaon                          East Khandesh District  District
320 17492  105 IND  India   21 Maharashtra  320          Jalna                                        District  District
321 17493  105 IND  India   21 Maharashtra  321       Kolhapur                                        District  District
322 17494  105 IND  India   21 Maharashtra  322          Latur                Kulaba, Kolaba, Kolabad District  District
323 17495  105 IND  India   21 Maharashtra  323         Nagpur                                        District  District
324 17496  105 IND  India   21 Maharashtra  324         Nanded                                 Nander District  District
325 17497  105 IND  India   21 Maharashtra  325      Nandurbar                                        District  District
    pop pop2 pop3
306   5    2    6
307   8    5    1
308   2    4    4
309   2    6   10
310   8    7    5
311   9   10    1
312   8    9    4
313   4    9    3
314   1    8    7
315   9    5    7
316   7    8    4
317   9    8    6
318   1   10    3
319   1    8    6
320   8    6   10
321   8    4    8
322   4    9    2
323   5    3    5
324   4    8   10
325   1    5    1
> par(mfrow=c(3,1))
> plot(mahadm,col=mahadm$pop)
1
> plot(mahadm,col=mahadm$pop2)
> plot(mahadm,col=mahadm$pop3)

Some SAS code for beginners

So I was talking to someone on SAS University Edition  and I wanted to show how easy SAS language is. This was some code I came up with with output commented out

SAS code here;

/*NOTE COMMENTS CAN BE GIVEN BY SELECTING A LINE AND PRESSING CTRL and / */
/* AUTOEXEC file loads starting up commands*/
/* Using different formats */
data test;
format ajay ddmmyy6. ajay2 date9.;
ajay=today();
ajay2=today();
ajay3=today();
run; 

/* printing out output */
proc print data=test;
run;



/* The SAS System */
/* Obs ajay ajay2 ajay3 */
/* 1 080315 08MAR2015 20155 */
/* what datasets are there in a library */
proc datasets lib=work;
quit;

proc datasets lib=sashelp;
quit;

/* copying a dataset from one to another */
data test2;
set sashelp.cars;
run;

/* NOTE: The data set WORK.TEST2 has 428 observations and 15 variables. */
/* conditionally copying a dataset from one to another */
data test2;
set sashelp.cars;
where cylinders=8;
run;

/* */
/* NOTE: There were 87 observations read from the data set SASHELP.CARS. */
/* WHERE cylinders=8; */
/* what variables are there in a dataset */
proc contents data=test2 varnum;
quit;

/* what is the frequency and number of levels of certain variables in a dataset */
proc freq data=sashelp.cars nlevels;
tables make*cylinders/nocol nopercent nocum norow;
quit;

/* what is a cross tab frequency of two or more variables */
proc freq data=test2;
tables make*cylinders;
quit;

/* what are some summary statistics of a variable */
proc means data=test2;
var mpg_city;
quit;

/* The MEANS Procedure */
/* Analysis Variable : MPG_City MPG (City) */
/* N Mean Std Dev Minimum Maximum */
/* 428 20.0607477 5.2382176 10.0000000 60.0000000 */

/* what are some summary statistics of a variable grouped by a class variable */
proc means data=test2 n p1 p75 std median mean max;
var mpg_city;
class cylinders;
quit;

/* The MEANS Procedure */
/* Analysis Variable : MPG_City MPG (City) */
/* Cylinders N Obs N 1st Pctl 75th Pctl Std Dev Median Mean Maximum */
/* 3 1 1 60.0000000 60.0000000 . 60.0000000 60.0000000 60.0000000 */
/* 4 136 136 18.0000000 26.0000000 5.2093430 24.0000000 24.9411765 59.0000000 */
/* 5 7 7 18.0000000 20.0000000 0.8997354 20.0000000 19.8571429 21.0000000 */
/* 6 190 190 14.0000000 20.0000000 1.7630130 19.0000000 18.5157895 23.0000000 */
/* 8 87 87 10.0000000 17.0000000 1.8912565 16.0000000 15.8735632 18.0000000 */
/* 10 2 2 10.0000000 12.0000000 1.4142136 11.0000000 11.0000000 12.0000000 */
/* 12 3 3 12.0000000 13.0000000 0.5773503 13.0000000 12.6666667 13.0000000 */
/* making a libname */
libname sas2 "/folders/myfolderssasuser.v94";
quit;

/* importing data from a file */
proc import datafile="/folders/myfolders/sasuser.v94/adult.data" dbms=csv
out=ajay.adult;
quit;

proc contents data=adult varnum;
quit;
/*--Histogram--*/
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
histogram mpg_city;
/* density mpg_city / lineattrs=(pattern=solid); */
/* density mpg_city / type=kernel lineattrs=(pattern=solid); */
/* keylegend / location=inside position=topright across=1; */
/* yaxis offsetmin=0 grid; */
run;
title 'mpg_city';
proc sgplot data=sashelp.cars;
histogram mpg_city ;
/* density mpg_city / lineattrs=(pattern=solid); */
/* density mpg_city / type=kernel lineattrs=(pattern=solid); */
/* keylegend / location=inside position=topright across=1; */
/* yaxis offsetmin=0 grid; */
run;

proc contents data =sashelp.cars varnum;
run;

 

SAS Data Loader for Hadoop is now a 90 day free trial

From-

http://www.cloudera.com/content/cloudera/en/downloads/quickstart_vms/cdh-5-3-x.html

 

SAS Data Loader for Hadoop eliminates the complexities of writing MapReduce code, with a simple, point-and-click interface that empowers business analysts to prepare, integrate and cleanse big data faster and easier than ever. In addition, data scientists and programmers can run SAS code on Hadoop in parallel for better performance and greater productivity.

 


Get Started

  1. Download and install Cloudera QuickStart VM for CDH 5.3x.
  2. Download and install either VMware Player 6.0 or later (for Windows) or VMware Fusion for OS X 6.0 (for Mac).
  3. Download and install your 90-day free trial of SAS Data Loader for Hadoop.

and

from

http://www.sas.com/en_us/software/data-management/data-loader-hadoop.html