[R] document methods in Reference Classes

2013-04-23 Thread Andrea Franceschini
Dear all,

I would like to get informations on how to document Reference Classes.

I noticed that for every normal S4 method there is normally a corresponding
.Rd file in the man directory of the package.
Is this valid also for methods of the reference classes ?
Apparently the package.skeleton function do NOT generate those files
automatically for methods of a reference class. Am I supposed to create
those files manually ?

Thx a lot for the help,
Best Regards,
Andrea Franceschini

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] write merged data frame to a file

2011-07-19 Thread Andrea Franceschini
Very Sorry for the instinctive bad comment...  I didn't express
correctly what I meant.
I meant that I would have never expected such behaviour, by default
(but may be I am wrong and most of the people need quoting, and hence
has sense to put it by default)

Problem solved,
Philipp guessed right.
It was just a quoting problem on the gene description.
The problem could be solved simply adding the (quote=) parameter to
the read.table command.

The quoting problem reversed into that strange behavior when I merged
two table (I don't know why).

Thankyou very much for the assistance,
Now that I realized that the quoting exists I can enjoying using R
(that as a tool perfectly suits my needs at the moment).

Have a nice day,
Andrea



On Mon, Jul 18, 2011 at 7:36 PM, David Winsemius dwinsem...@comcast.net wrote:

 On Jul 18, 2011, at 11:10 AM, Andrea Franceschini wrote:

 Dear Philipp,


 You were right,
 thankyou very much.
 Effectively the second read.table didn't work (probably because of the
 strange characters).

 From my point of view this is a very bad R bug.

 When I read this I thought it was an example of a young person just starting
 their education exhibiting Piaget's preoperational stage when applied to
 the task of learning a computer language.

 the child begins to use symbols to represent objects. Early in this stage
 he also personifies objects. [snipped]  His thinking is influenced by
 fantasy -- the way he'd like things to be -- and he assumes that others see
 situations from his viewpoint.

 [Copied from a webpage for grade school teachers:
 http://www2.honolulu.hawaii.edu/facdev/guidebk/teachtip/piaget.htm ]

 But when I do a search in PubMed, I find that you may be an established
 researcher, so I thing the onus is now on you to demonstrate how R's
 behavior is different than the documented design goals for the read.table
 function.

 I precisely inserted the \t separator in the read table command,
 hence I would expect that everything is working.
 How can I make it work ???

 I thought Pagel already gave you the answer, but your response is too
 general to be sure. What exactly did you find and can you provide a minimal
 code and data example that illustrates how read.table is acting in any way
 different than the documentation describes?

 --
 David.


 Effectively there are several ' (i.e. apostrophe) characters in the
 file. I guess are those that confuse R


 Thankyou very much,
 Best Regards,
 Andrea




 On Mon, Jul 18, 2011 at 4:32 PM, Philipp Pagel p.pa...@wzw.tum.de wrote:

 On Mon, Jul 18, 2011 at 04:00:29PM +0200, Andrea Franceschini wrote:

 I use version 13 of R in OSX (downloaded and installed less than 1 year
 ago).

 Probably 2.13 ...

 [...] code omitted

 The first lines are OK (i.e. 14 columns, like the dataframe), while at
 a certain point I get lines with only 3 columns !!!
 The bad lines that contain only 3 columns have the name and the
 description of the gene (i.e. the content of the file that I merged
 with).
 Besides, these strange lines also get repeated (see the bottom).

 I havent't carefully analyzed your code so I may be wrong but my guess
 for
 all weird behaviour of gene related data.frames problems is this:

 Gene descriptions love to contain things like Foo 5' obfuscation
 factor.  Note the ' in the description which read.table will
 happily interpret as a quotation mark and eat lots of rows until it
 happens to encouter a closing counterpart. This leads to all kinds of
 funny results. So I bet your problem is not in write.table but in
 reading the data. Have a closer look at your data frame: are you
 really getting the expected number of observations in the merged
 data.frame? Are the rows in question really ok in the data frame? If
 my guess is correct you should be able to fix your problem by
 including quote= in both your read.table commands.

 If it doesn't, also try comment.char= - another popular source of
 problems.

 cu
       Philipp

 --
 Dr. Philipp Pagel
 Lehrstuhl für Genomorientierte Bioinformatik
 Technische Universität München
 Wissenschaftszentrum Weihenstephan
 85350 Freising, Germany
 http://webclu.bio.wzw.tum.de/~pagel/


 __
 R-help@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.

 David Winsemius, MD
 West Hartford, CT



__
R-help@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] write merged data frame to a file

2011-07-18 Thread Andrea Franceschini
Dear all,

I merged 2 data frames using the merged command and the resulting data frame
looks perfect into R.

However, I have serious problems when I try to write this new data frame
into a file using the write.table command.

Basically I get parts of the second file that I merged into the file.

What could it be the problem ?

Thankyou very much,
Best Regards,
Andrea

--
View this message in context: 
http://r.789695.n4.nabble.com/write-merged-data-frame-to-a-file-tp3674924p3674924.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] write merged data frame to a file

2011-07-18 Thread Andrea Franceschini
   homeobox B6
3217HOXB7   homeobox B7
3218HOXB8   homeobox B8
3219HOXB9   homeobox B9
3220HOXC@   homeobox C cluster
3221HOXC4   homeobox C4
3222HOXC5   homeobox C5
3223HOXC6   homeobox C6
3224HOXC8   homeobox C8
3225HOXC9   homeobox C9
3226HOXC10  homeobox C10
3227HOXC11  homeobox C11
3228HOXC12  homeobox C12
3229HOXC13  homeobox C13
3230HOXD@   homeobox D cluster
3231HOXD1   homeobox D1
3232HOXD3   homeobox D3
3233HOXD4   homeobox D4
3234HOXD8   homeobox D8
3235HOXD9   homeobox D9
3236HOXD10  homeobox D10
3237HOXD11  homeobox D11
3238HOXD12  homeobox D12
3239HOXD13  homeobox D13
3240HP  haptoglobin
3241HPCAL1  hippocalcin-like 1
3242HPD 4-hydroxyphenylpyruvate dioxygenase
3244HPE1holoprosencephaly 1, alobar
3247HPFH2   hereditary persistence of fetal hemoglobin, heterocellular,
Indian type
3248HPGDhydroxyprostaglandin dehydrogenase 15-(NAD)
3249HPN hepsin
3250HPR haptoglobin-related protein
3251HPRT1   hypoxanthine phosphoribosyltransferase 1
3254HPRTP2  hypoxanthine phosphoribosyltransferase pseudogene 2
3255HPRTP3  hypoxanthine phosphoribosyltransferase pseudogene 3
3257HPS1Hermansky-Pudlak syndrome 1
3258HPT hypoparathyroidism
3259HPV6AI1 human papillomavirus (type 6a) integration site 1
3260HPV18I1 human papilloma virus (type 18) integration site 1
3261HPV18I2 human papillomavirus (type 18) integration site 2
3262HPVC1   human papillomavirus (type 18) E5 central sequence-like 1
3263HPX hemopexin
3265HRASv-Ha-ras Harvey rat sarcoma viral oncogene homolog
3266ERASES cell expressed Ras
3267AGFG1   ArfGAP with FG repeats 1
3268AGFG2   ArfGAP with FG repeats 2
3269HRH1histamine receptor H1
3270HRC histidine rich calcium binding protein
3272HRES1   HTLV-1 related endogenous sequence
3273HRG histidine-rich glycoprotein
3274HRH2histamine receptor H2
3275PRMT2   protein arginine methyltransferase 2
3276PRMT1   protein arginine methyltransferase 1
3278HRPT1   hyperparathyroidism 1
3280HES1hairy and enhancer of split 1, (Drosophila)
3281HSBP1   heat shock factor binding protein 1
3283HSD3B1  hydroxy-delta-5-steroid dehydrogenase, 3 beta- and steroid
delta-isomerase 1
3284HSD3B2  hydroxy-delta-5-steroid dehydrogenase, 3 beta- and steroid
delta-isomerase 2
3290HSD11B1 hydroxysteroid (11-beta) dehydrogenase 1
3291HSD11B2 hydroxysteroid (11-beta) dehydrogenase 2
3292HSD17B1 hydroxysteroid (17-beta) dehydrogenase 1
3293HSD17B3 hydroxysteroid (17-beta) dehydrogenase 3
3294HSD17B2 hydroxysteroid (17-beta) dehydrogenase 2
3295HSD17B4 hydroxysteroid (17-beta) dehydrogenase 4
3297HSF1heat shock transcription factor 1
3298HSF2heat shock transcription factor 2
3299HSF4heat shock transcription factor 4
3300DNAJB2  DnaJ (Hsp40) homolog, subfamily B, member 2
3301DNAJA1  DnaJ (Hsp40) homolog, subfamily A, member 1
3303HSPA1A  heat shock 70kDa protein 1A
3304HSPA1B  heat shock 70kDa protein 1B
3305HSPA1L  heat shock 70kDa protein 1-like
3306HSPA2   heat shock 70kDa protein 2
3308HSPA4   heat shock 70kDa protein 4
3309HSPA5   heat shock 70kDa protein 5 (glucose-regulated protein, 78kDa)
3310HSPA6   heat shock 70kDa protein 6 (HSP70B)
31880.7339296   1242SI00439852  425 3319
UGUAGCUCUAACGAUACCGGG   GUAGCU  GUAGCUC 0.69809605  1541HNRNPH2 
heterogeneous
nuclear ribonucleoprotein H2 (H)
3189HNRNPH3 heterogeneous nuclear ribonucleoprotein H3 (2H9)
3190HNRNPK  heterogeneous nuclear ribonucleoprotein K
3191HNRNPL  heterogeneous nuclear ribonucleoprotein L
3192HNRNPU  heterogeneous nuclear ribonucleoprotein U (scaffold
attachment factor A)
3193HOAChypoacusis 2 (autosomal recessive)
3195TLX1T-cell leukemia homeobox 1
3196TLX2T-cell leukemia homeobox 2
3197HOXA@   homeobox A cluster
3198HOXA1   homeobox A1
3199HOXA2   homeobox A2
3200HOXA3   homeobox A3
3201HOXA4   homeobox A4


Thankyou very much,
Best Regards,
Andrea






On Mon, Jul 18, 2011 at 2:45 PM, Sarah Goslee sarah.gos...@gmail.com wrote:
 Hi Andrea,

 On Mon, Jul 18, 2011 at 6:07 AM, Andrea Franceschini ata...@gmail.com wrote:
 Dear all,

 I merged 2 data frames using the merged command and the resulting data frame
 looks perfect into R.

 However, I have serious problems when I try to write this new data frame
 into a file using the write.table command.

 Basically I get parts of the second file that I merged into the file.

 What could it be the problem ?

 I have no idea. What did you do? What does your new data frame look like?
 What commands did you issue? What result did you get? What result did
 you expect? Can you provide a small reproducible example, or at least
 a great deal more information? str() is a good

Re: [R] write merged data frame to a file

2011-07-18 Thread Andrea Franceschini
Dear Philipp,


You were right,
thankyou very much.
Effectively the second read.table didn't work (probably because of the
strange characters).
From my point of view this is a very bad R bug.
I precisely inserted the \t separator in the read table command,
hence I would expect that everything is working.
How can I make it work ???
Effectively there are several ' (i.e. apostrophe) characters in the
file. I guess are those that confuse R


Thankyou very much,
Best Regards,
Andrea




On Mon, Jul 18, 2011 at 4:32 PM, Philipp Pagel p.pa...@wzw.tum.de wrote:
 On Mon, Jul 18, 2011 at 04:00:29PM +0200, Andrea Franceschini wrote:

 I use version 13 of R in OSX (downloaded and installed less than 1 year ago).

 Probably 2.13 ...

 [...] code omitted

 The first lines are OK (i.e. 14 columns, like the dataframe), while at
 a certain point I get lines with only 3 columns !!!
 The bad lines that contain only 3 columns have the name and the
 description of the gene (i.e. the content of the file that I merged
 with).
 Besides, these strange lines also get repeated (see the bottom).

 I havent't carefully analyzed your code so I may be wrong but my guess for
 all weird behaviour of gene related data.frames problems is this:

 Gene descriptions love to contain things like Foo 5' obfuscation
 factor.  Note the ' in the description which read.table will
 happily interpret as a quotation mark and eat lots of rows until it
 happens to encouter a closing counterpart. This leads to all kinds of
 funny results. So I bet your problem is not in write.table but in
 reading the data. Have a closer look at your data frame: are you
 really getting the expected number of observations in the merged
 data.frame? Are the rows in question really ok in the data frame? If
 my guess is correct you should be able to fix your problem by
 including quote= in both your read.table commands.

 If it doesn't, also try comment.char= - another popular source of
 problems.

 cu
        Philipp

 --
 Dr. Philipp Pagel
 Lehrstuhl für Genomorientierte Bioinformatik
 Technische Universität München
 Wissenschaftszentrum Weihenstephan
 85350 Freising, Germany
 http://webclu.bio.wzw.tum.de/~pagel/


__
R-help@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] hypergeometric vs fisher.test

2010-08-13 Thread Andrea Franceschini

Dear R team,
I have a simple question.

I tried this command:
phyper(17,449,19551,181, FALSE)
[1] 1.47295e-07

and then I tried this command:
(fisher.test(matrix(c(17,449,181,19551),2,2),
alternative='greater'))$p.value
[1] 3.693347e-06


Shouldn't be identical the results of the two commands ?
What is the difference ?

Thx a lot
-- 
View this message in context: 
http://r.789695.n4.nabble.com/hypergeometric-vs-fisher-test-tp2324223p2324223.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread Andrea Franceschini

I ask the question also because I found this line in Wikipedia:
The test (see above) based on the hypergeometric distribution
(hypergeometric test) is identical to the corresponding one-tailed
version of Fisher's exact test.

Is this wrong ?  May I kindly ask a friendly explanation for
not-experts in statistics ?

Thx a lot,

-- 
View this message in context: 
http://r.789695.n4.nabble.com/hypergeometric-vs-fisher-test-tp2324223p2324429.html
Sent from the R help mailing list archive at Nabble.com.

[[alternative HTML version deleted]]

__
R-help@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.