Re: [R] Question

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Wed, 18 Jun 2008 19:45:37 -0300

Try this:

xtabs(value ~ Grade + location, data = dat)

On 6/18/08, Zolfaghari, Arvin <Arvin.Zolfaghari_at_lloyds.com> wrote:
>
> Hi list,
> I am trying to convert my Data from 1st following format to the second.
> Any comment?
>
> You could copy following in Tinn R
> Data<-
> data.frame(location=c("postcode","sector","long/lat","sector"),Grade=c("
> h","m","L","h"),value=c(2,3,5,6))
> #Question: how can I reshape Data to the following
> # Grade postcode sector long/lat
> # h 2 6 0
> # m 0 3 0
> # l 0 0 5
>
>
> Regards,
>
> Arvin Zolfaghari
> Lead Researcher, PhD MSc BSc
> Lloyd's Exposure Management
> Telephone +44 (0)20 7327 5983
> www.lloyds.com <http://www.lloyds.com/>
>
> SAVE PAPER - THINK BEFORE YOU PRINT
>
>
> **********************************************************************
> The information in this E-Mail and in any attachments is...{{dropped:22}}
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]


______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Wed 18 Jun 2008 - 23:16:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 Jun 2008 - 23:31:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive