Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Replace Indices By Names



> city.name <- c("Munich", "Paris", "Tokyo", "London", "Boston")
> X <- cbind(c(2, 5, 5), c(4, 1, 3))
> X
       [,1] [,2]
  [1,]    2    4
  [2,]    5    1
  [3,]    5    3
> matrix(city.name[X], ncol = 2)
       [,1]     [,2]    
  [1,] "Paris"  "London"
  [2,] "Boston" "Munich"
  [3,] "Boston" "Tokyo"



Copyright © 2004-2010 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010