[R] Edit 2

2011-08-22 Thread RobinLovelace
Sorry to anyone who tried but failed to download the data - seems not to be there. Here's a new link to it please take a look. http://ubuntuone.com/p/1C6U/ -- View this message in context: http://r.789695.n4.nabble.com/Histogram-from-frequency-data-in-pre-made-bins-tp3758198p3760458.html Sent f

Re: [R] Histogram from frequency data in pre-made bins

2011-08-22 Thread RobinLovelace
Update: I have recreated an artificial distribution using uniform random numbers n <- c(runif(Car[1],0,2), runif(Car[2],2,5),runif(Car[3],5,10), runif(Car[4],10,20), runif(Car[5],20,30), runif(Car[6],30,40), runif(Car[7],40,60), runif(Car[8],60,200) ) The resulting density distri

[R] Histogram from frequency data in pre-made bins

2011-08-21 Thread RobinLovelace
Dear R user, I am using UK census data on travel to work. The authorities have provided a breakdown in each area by mode (car, bicycle etc.) and distance travelled (0 – 2 km, 2 – 5 km etc). Therefore, after processing, the data for Sheffield look like this https://files.one.ubuntu.com/ej2VtVbJTEael

Re: [R] "Denormalize" data

2011-08-11 Thread RobinLovelace
Hi Jeff, yes I can confirm that the xtabs solution does not work with the original method. Here's how it went: HHum02 <- Hum02[1:30,] # select subset for demonstration purposes > HHum02[1:5,] CASW Btype Yr CO2Group NumVeh 170597 00CCFA CARS 2002C 2 170598 00CCFA CARS 2002

Re: [R] "Denormalize" data

2011-08-09 Thread RobinLovelace
Hi David Winsemius, thanks a lot for the answer that I finally spotted amongst my verbose message. Many thanks, and I see that it does work now: I had to change the variable names of the subset HHum02 because all the rows from main dataset were still there invisibly (after I used subset to remove

Re: [R] "Denormalize" data

2011-08-09 Thread RobinLovelace
Hi David Winsemius, thanks for the input but your reply seems to omit any answer! Anyway, I've figured this out for myself, with some help from the reshape package. Solution: mdata <- melt(Humn02) Denormal <- cast(mdata, CASW~CO2Group~variable, sum) Check out the power of the reshape package h

[R] "Denormalize" data

2011-08-09 Thread RobinLovelace
Hello R users, My problem is that the data I've got is in the minimum number of columns with each ward (geographic area) appearing multiple times. The first 30 terms look like this > HHum02 CASW Btype Yr CO2Group NumVeh 170597 00CCFA CARS 2002C 2 170598 00CCFA CARS 2