[Rd] Visibility of methods in different namespaces

2010-07-22 Thread Thomas Etheber

Hey folks,

I read plenty of material and started to write some new R-packages, but 
actually I am looking for a solution of the following problem. Perhaps 
it's a beginners question for creating packages, but I wasn't able to 
track it down yet. Hopefully you can provide me with a solution or at 
least some adequate readings.


I have a package say it's called "AAA" with an S4-object say it's called 
"aObject". On the other hand I have a package "BBB" with an S4-object 
called "bObject".
Both objects want to provide the same method to outside users, the 
method is called "calculateModel" and they were implemented in the 
package using the following S3 notation:


Package AAA:
---
calculateModel <- function( object, ...) { UseMethod( "calculateModel") }
calculateModel.aObject <- function( object, ..., 
someAdditionalParameters ) { bla bla }


Package BBB:
---
calculateModel <- function( object, ...) { UseMethod( "calculateModel") }
calculateModel.bObject <- function( object, ..., 
someAdditionalParameters ) { bla bla }



In the NAMESPACE file of package AAA and package BBB, I registered the 
methods using:


Package AAA:
---
S3method( "calculateModel", "aObject" )
export( "calculateModel"  )

Package BBB:
---
S3method( "calculateModel", "bObject" )
export( "calculateModel"  )

Everything works fine, when I load only one of the packages. But if I 
load both packages together, one of the calculateModel methods 
disappears and is no longer visible, which results in an error.


What am I missing?

Thanks!
Thomas

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] How to connect R to Mysql?

2010-09-17 Thread Thomas Etheber

I also had problems connecting via RMysql on Windows several weeks ago.
I decided to skip the package and now use RODBC, which runs stable out 
of the box. Perhaps you should have a look at this package.


Hth
Thomas

Am 17.09.2010 17:50, schrieb Spencer Graves:



  I've recently been through that with some success.  I don't 
remember all the details, but I first looked at "help(pac=RMySQL)".   
This told me that the maintainer was Jeffrey Horner.  Google told me 
he was at Vanderbilt.  Eventually I found 
"http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL";, which told me 
that I needed to build the package myself so it matches your version 
of MySQL, operating system, etc.  I did that.



  Does the MySQL database already exist?  I created a MySQL 
database and tables using MySQL server 5.1.50-win32.  (Which version 
of MySQL do you have?)



  help('RMySQL-package') includes "A typical usage".  That helped 
me get started, except that I needed to write to that database, not 
just query it.  For this, I think I got something like the following 
to work:



d <- dbReadTable(con, "WL")
dbWriteTable(con, "WL2", a.data.frame)  ## table from a data.frame
dbWriteTable(con, "test2", "~/data/test2.csv") ## table from a file


  Hope this helps.
  Spencer


On 9/17/2010 7:55 AM, Arijeet Mukherjee wrote:

I installed the RMySql package in R 2.11.1 64 bit
Now how can I connect R with MySql?
I am using a windows 7 64 bit version.
Please help ASAP.






__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel