[R] "parallel" package

R. Michael Weylandt michael.weylandt at gmail.com
Sun Apr 29 13:45:16 CEST 2012


You seem confused.... the library Uwe is talking about is a function
not a string....

These work

library(quantmod)
library("quantmod")

or

pkg <- "quantmod"

library(pkg) # Doesn't work!

library(pkg, character.only = TRUE) # Works

Michael

On Sun, Apr 29, 2012 at 3:59 AM,  <admin at use-r.com> wrote:
> I just tried it.
>
>> library <- "quantmod"
>> library
> [1] "quantmod"
>> typeof(library)
> [1] "character"
>
> So how do I , or anyone , assign a string without " "?
>
>> library <- quantmod
> Error: object 'quantmod' not found
>
> What about this?
>
>> library <- c("quantmod")
>
> Does it do the job? Sorry if it has been asked. I'm still learning R.
>
>>
>>
>> On 29.04.2012 09:28, Indrajit Sengupta wrote:
>>> You don't need quotes in the library statement, you can just use
>>> library(parallel).
>>
>> Yes, a special (mis-)feature of library(). Since we are trying to teach
>> R here, we should provide clean R code. In an ideal world, we would be
>> able to say
>>
>> pkg <- "parallel"
>> library(pkg)
>>
>> doing the same as
>>
>> library("parallel")
>>
>> which is unfortunately not possible, because library(pkg) tries a
>> package called "pkg".
>>
>> Best,
>> Uwe Ligges
>>
>>
>>
>>>
>>> Regards,
>>> Indrajit
>>>
>>>
>>>
>>> ________________________________
>>> From: Uwe Ligges<ligges at statistik.tu-dortmund.de>
>>> To: ya<xinxi813 at 163.com>
>>> Cc: r-help at r-project.org
>>> Sent: Saturday, April 28, 2012 11:57 PM
>>> Subject: Re: [R] "parallel" package
>>>
>>>
>>>
>>> On 28.04.2012 20:18, ya wrote:
>>>> Hi everyone,
>>>>
>>>> Anyone knows Where I can get the "parallel" package? The google results
>>>> said this package has been released since R 2.14, but I could not find
>>>> a
>>>> place to get it.
>>>>
>>>> I am doing a multiple imputation for missing values, it is really time
>>>> consuming. I figured maybe it's more efficient by paralleling my CPU. I
>>>> got an intel dual core i5 processor in a Thankpad x201 laptop. And I
>>>> have used install.packages ("parallel") in R 2.15 on both linux and
>>>> windows xp, no package installed. So maybe this package is not on cran?
>>>> Any idea?
>>>
>>> It is shipped as an R base packaage. Just use
>>>
>>> library("parallel")
>>>
>>> Uwe Ligges
>>>
>>>
>>>> Thank you very much.
>>>>
>>>> ya
>>>>
>>>> ______________________________________________
>>>> 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.
>>>
>>> ______________________________________________
>>> 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.
>>
>> ______________________________________________
>> 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.
>>
>
> ______________________________________________
> 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.



More information about the R-help mailing list