Difference between revisions of "Power.R"

From Organic Design wiki
(Enter data)
 
(Second attempt)
Line 1: Line 1:
 +
vnames <- c("Date","Reading","Estimate","Daily consumption","cents per Kwh","Dollars")
 
dset <- scan(sep=",", what="")
 
dset <- scan(sep=",", what="")
"Date","Reading","Estimate","Daily consumption","cents per Kwh","Dollars"
 
 
24/12/04,30987,0,0,0,0
 
24/12/04,30987,0,0,0,0
 
19/01/05,31294,0,11.8,14.07,65.99
 
19/01/05,31294,0,11.8,14.07,65.99
Line 25: Line 25:
 
""
 
""
  
dim(dset) <- c(6,23)
+
dim(dset) <- c(6,22)
 
dset <- t(dset)
 
dset <- t(dset)
 +
 +
dset <- data.frame(dset)
 +
names(dset) <- vnames
 +
 +
dset

Revision as of 06:49, 10 October 2006

vnames <- c("Date","Reading","Estimate","Daily consumption","cents per Kwh","Dollars") dset <- scan(sep=",", what="") 24/12/04,30987,0,0,0,0 19/01/05,31294,0,11.8,14.07,65.99 15/02/05,31910,1,22,14.07,116.26 15/03/05,32121,0,7.5,14.07,52.15 16/05/05,33114,0,17.9,14.07,113.79 15/06/05,33564,1,15,14.53,93.98 15/07/05,34765,0,40,14.53,216.7 16/08/05,35245,1,15,14.53,100.23 15/09/05,37356,0,70.4,14.53,365.44 17/10/05,37836,1,15,14.53,100.25 15/11/05,38957,0,38.7,14.53,211.28 16/12/05,39422,1,15,15.7,104.67 17/01/06,40115,0,21.7,15.7,145.69 14/02/06,40535,1,15,15.7,94.55 15/03/06,41148,0,21.1,15.7,129.33 12/04/06,41568,1,15,16.4,96.15 15/05/06,43284,0,52,16.4,341.09 15/06/06,44121,1,27,16.4,177.46 29/06/06,44241,1,9.23,14.78,24.83 31/08/06,44811,1,9.05,14.78,118.41 28/09/06,52471,0,273.57,14.78,1284.17 10/10/06,53080,0,50.75,14.78,NA ""

dim(dset) <- c(6,22) dset <- t(dset)

dset <- data.frame(dset) names(dset) <- vnames

dset