[R] loading both RPostgreSQL and RSQLite leads to problems
Martin Morgan
mtmorgan at fhcrc.org
Fri Nov 9 01:34:07 CET 2012
On 11/8/2012 11:43 AM, Jon McAuliffe wrote:
>
> hi martin,
>
> i have installed 2.15.2 and tried your code example below, but
> i still get the same error:
>
>
>> library(RSQLite)
> Loading required package: DBI
>> library(RPostgreSQL)
>> dbDriver('PostgreSQL')
> Error in function (classes, fdef, mtable) :
> unable to find an inherited method for function show for signature "PostgreSQLDriver"
>
>
> are you able run this successfully in 2.15.2?
This works for me with R-devel
> library(RSQLite)
Loading required package: DBI
> library(RPostgreSQL)
> dbDriver("PostgreSQL")
An object of class "PostgreSQLDriver"
Slot "Id":
[1] 12873
> sessionInfo()
R Under development (unstable) (2012-11-04 r61084)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics utils datasets grDevices methods base
other attached packages:
[1] RPostgreSQL_0.3-3 RSQLite_0.11.2 DBI_0.2-5
but not R-2.15.2
> library(RSQLite)
Loading required package: DBI
> library(RPostgreSQL)
> dbDriver("PostgreSQL")
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function ‘show’ for signature
‘"PostgreSQLDriver"’
> sessionInfo()
R version 2.15.2 Patched (2012-11-07 r61093)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RPostgreSQL_0.3-3 RSQLite_0.11.2 DBI_0.2-5
>
> thanks
> jon.
>
>
> On Aug 23, 2012, at 12:38 PM, Martin Morgan wrote:
>
>> On 08/22/2012 01:35 PM, Jon McAuliffe wrote:
>>> hello,
>>>
>>> if i load the RSQLite package in addition to the RPostgreSQL package,
>>> i get various errors when trying to use RPostgreSQL functions. here is
>>> an example transcript showing one such error:
>>>
>>>
>>> ==========================================================
>>> R version 2.15.0 (2012-03-30)
>>> [...]
>>>> packageVersion('RPostgreSQL')
>>> [1] 0.3.2
>>>> packageVersion('RSQLite')
>>> [1] 0.11.1
>>>> library(RPostgreSQL)
>>> Loading required package: DBI
>>>> dbDriver('PostgreSQL')
>>> <PostgreSQLDriver:(32540)>
>>>> library(RSQLite)
>>>> dbDriver('PostgreSQL')
>>> Error in function (classes, fdef, mtable) :
>>> unable to find an inherited method for function "show", for signature "PostgreSQLDriver"
>>
>> Hi Jon --
>>
>> It seems like this has been addressed in the devel version of R
>>
>>> library(RSQLite)
>> Loading required package: DBI
>>> library(RPostgreSQL)
>>> dbDriver("PostgreSQL")
>> An object of class "PostgreSQLDriver"
>> Slot "Id":
>> [1] 12355
>>
>>> sessionInfo()
>> R Under development (unstable) (2012-08-20 r60336)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>> locale:
>> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
>> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
>> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
>> [7] LC_PAPER=C LC_NAME=C
>> [9] LC_ADDRESS=C LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics grDevices utils datasets methods base
>>
>> other attached packages:
>> [1] RPostgreSQL_0.3-2 RSQLite_0.11.1 DBI_0.2-5
>>
>>
>>> ==========================================================
>>>
>>>
>>> below is the output of showMethods('show') in two scenarios:
>>> (1) RPostgreSQL loaded, RSQLite not loaded;
>>> (2) RPostgreSQL loaded, RSQLite loaded (in that order).
>>> i'd be grateful for any help resolving or working around this issue.
>>> if possible, please include my email address in any reply.
>>>
>>> best
>>> jon mcauliffe
>>> jon at mcauliffe.com
>>>
>>>
>>>
>>> (1)
>>>> showMethods('show')
>>> Function: show (package methods)
>>> object="ANY"
>>> object="classGeneratorFunction"
>>> object="classRepresentation"
>>> object="dbObjectId"
>>> object="envRefClass"
>>> object="function"
>>> (inherited from: object="ANY")
>>> object="genericFunction"
>>> object="genericFunctionWithTrace"
>>> object="MethodDefinition"
>>> object="MethodDefinitionWithTrace"
>>> object="MethodSelectionReport"
>>> object="MethodWithNext"
>>> object="MethodWithNextWithTrace"
>>> object="namedList"
>>> object="ObjectsWithPackage"
>>> object="oldClass"
>>> object="PostgreSQLDriver"
>>> (inherited from: object="dbObjectId")
>>> object="refClassRepresentation"
>>> object="refMethodDef"
>>> object="refObjectGenerator"
>>> object="signature"
>>> object="sourceEnvironment"
>>> object="standardGeneric"
>>> (inherited from: object="genericFunction")
>>> object="traceable"
>>>
>>>
>>> (2)
>>>> showMethods('show')
>>> Function: show (package methods)
>>> object="ANY"
>>> object="classGeneratorFunction"
>>> object="classRepresentation"
>>> (2 methods defined for this signature, with different packages)
>>> object="envRefClass"
>>> object="genericFunction"
>>> object="genericFunctionWithTrace"
>>> object="MethodDefinition"
>>> object="MethodDefinitionWithTrace"
>>> object="MethodSelectionReport"
>>> object="MethodWithNext"
>>> object="MethodWithNextWithTrace"
>>> object="namedList"
>>> object="ObjectsWithPackage"
>>> object="oldClass"
>>> object="refClassRepresentation"
>>> object="refMethodDef"
>>> object="refObjectGenerator"
>>> object="signature"
>>> object="sourceEnvironment"
>>> object="traceable"
>>>
>>> ______________________________________________
>>> 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.
>>>
>>
>>
>> --
>> Computational Biology / Fred Hutchinson Cancer Research Center
>> 1100 Fairview Ave. N.
>> PO Box 19024 Seattle, WA 98109
>>
>> Location: Arnold Building M1 B861
>> Phone: (206) 667-2793
>
--
Dr. Martin Morgan, PhD
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
More information about the R-help
mailing list