R-Forge Logo

If you love the Windows registry, you'll like hkey.


> library(hkey)
> hkey()

Win32 registry node: HKEY_LOCAL_MACHINE
Use names() to list subkeys and data, $, [], [[]] to extract them.


> names(hkey())

[1] "HARDWARE/" "SAM/"      "SECURITY/" "SOFTWARE/" "SYSTEM/"  


> x <- hkey("HKEY_LOCAL_MACHINE/SOFTWARE")
> names(x)

 [1] "781/"                          "Adi/"                         
 [3] "Adobe/"                        "Agere/"                       
 [5] "Ahead/"                        "Alps/"                        
 [7] "ALPS Electric Co., Ltd./"      "Analog Devices/"              
 [9] "Andrea Electronics/"           "Ariad/"                       
...
[47] "Skype/"                        "Staccato/"                    
[49] "Sun Microsystems/"             "TOSHIBA/"                     
[51] "Wilson WindowWare/"            "Windows/"                     
[53] "Windows 3.1 Migration Status/" "Wireless/"                    

> x <- x$"R-core"
> names(x)

[1] "R/"

> x <- x[["R"]]
> x[]

$`2.2.1`
Win32 registry node: HKEY_LOCAL_MACHINE/SOFTWARE/R-core/R/2.2.1
Use names() to list subkeys and data, $, [], [[]] to extract them.
...
$`2.4.1`
Win32 registry node: HKEY_LOCAL_MACHINE/SOFTWARE/R-core/R/2.4.1
Use names() to list subkeys and data, $, [], [[]] to extract them.

$`Current Version`
[1] "2.4.1"
attr(,"class")
[1] "REG_SZ"

$InstallPath
[1] "C:\\Program Files\\R\\R-2.4.1"
attr(,"class")
[1] "REG_SZ"

> as.list(x)
$`2.2.1`
$`2.2.1`$InstallPath
[1] "C:\\Program Files\\R\\R-2.2.1"

...

$`2.4.1`
$`2.4.1`$InstallPath
[1] "C:\\Program Files\\R\\R-2.4.1"


$`Current Version`
[1] "2.4.1"

$InstallPath
[1] "C:\\Program Files\\R\\R-2.4.1"


> x$new.value <- "This will be ignored by R, I hope"
> x$new.subnode <- list(a=12345, b=c("one","more","time"), d=as.raw(10:1), e=list(nesting=c(2,2)))
> as.list(x)

$`2.2.1`
$`2.2.1`$InstallPath
[1] "C:\\Program Files\\R\\R-2.2.1"

...

$new.subnode
$new.subnode$e
$new.subnode$e$nesting
[1] 2 2


$new.subnode$a
[1] 12345

$new.subnode$b
[1] "time" ""     ""    

$new.subnode$d
 [1] 0a 09 08 07 06 05 04 03 02 01


$`Current Version`
[1] "2.4.1"

$InstallPath
[1] "C:\\Program Files\\R\\R-2.4.1"

$new.value
[1] "This will be ignored by R, I hope"


> x[c("new.value", "new.subnode")] <- list(NULL, NULL)
> names(x)

[1] "2.2.1/"          "2.3.0/"          "2.3.1/"          "2.4.0/"          "2.4.1/"         
[7] "Current Version" "InstallPath"

The project summary page you can find here.