Re: [R] Power of t test for unequal variances?

2016-12-21 Thread Mauricio Cornejo via R-help
Winsemius <dwinsem...@comcast.net> wrote: > > >> On Dec 19, 2016, at 1:47 PM, Mauricio Cornejo via R-help >> <r-help@r-project.org> wrote: >> >> Is there a function similar to stats::power.t.test that can handle unequal >> variances from two

Re: [R] Power of t test for unequal variances?

2016-12-21 Thread Mauricio Cornejo via R-help
lesize do what you need/want.   Hth  --  Gerrit > On Dec 19, 2016, at 1:47 PM, Mauricio Cornejo via R-help > <r-help@r-project.org> wrote: > > Is there a function similar to stats::power.t.test that can handle unequal > variances from two samples? > I noticed that

[R] Power of t test for unequal variances?

2016-12-19 Thread Mauricio Cornejo via R-help
Is there a function similar to stats::power.t.test that can handle unequal variances from two samples? I noticed that stats::t.test has an argument for indicating whether or not to treat the two sample variances as equal.  Wondering why stats::power.t.test doesn’t have that option.

[R] Why does R start in wrong working directory despite R_USER setting?

2015-08-07 Thread Mauricio Cornejo via R-help
Hi After launching newly-installed R 3.2.1 (on Windows 7), I run the following two commands: getwd()[1] C:/ProgramData/Microsoft/Windows/Start Menu/Programs/R Sys.getenv('R_USER')[1] C:\\Users\\my username\\Documents I would like the startup working directory to be that pointed to by R_USER. I

[R] How to limit string size when displaying data frames?

2012-12-15 Thread Mauricio Cornejo
Hello, Is there a way to set the maximum width of character columns when printing a data frame? I've looked into print(), format(), and options() and have been unsuccessful. For example, I'd like to achieve the results below without having to modify the data itself. x -

Re: [R] How to limit string size when displaying data frames?

2012-12-15 Thread Mauricio Cornejo
AM, Mauricio Cornejo wrote: Hello, Is there a way to set the maximum width of character columns when printing a data frame? I've looked into print(), format(), and options() and have been unsuccessful. For example, I'd like to achieve the results below without having to modify

[R] switch() vs eval() for choosing pre-existing alternatives?

2012-12-03 Thread Mauricio Cornejo
Can anyone explain (perhaps with an example) why the R Language Definitions (Version 2.15.2, 2012-10-26, DRAFT) says the following in section 3.2.6? To choose from a list of alternatives that already exists switch() may not be the best way to select one for evaluation. It is often better to

[R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread Mauricio Cornejo
Hello, After reading help file, various threads on this board, and other online tutorials, I've attempted to use gsub (using Perl-like syntax) to change a currency string into something that can be converted to numeric type using only one regular expression.  Can anybody point out my error? 

Re: [R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread Mauricio Cornejo
Arun, thanks for both of your suggestions. I played with your second idea some more and seemed to have found a more general solution (If not a digit nor period then replace with blank).  x - \$ 1,200,300,400.50\  gsub([^0-9|.], , x, perl=TRUE) [1] 1200300400.50 Regards, Mauricio

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread Mauricio Cornejo
William, David, and Peter, Thank you all so much for your help on this.  Though I had read the help files on 'subset' and '[', I had not been able to discern from that text what the problem was.  I could not have solved it without your help. The help file on 'subset' mentions For ordinary

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread Mauricio Cornejo
on logical variable On 2012-08-28 07:44, Mauricio Cornejo wrote: William, David, and Peter, Thank you all so much for your help on this.  Though I had read the help files on 'subset' and '[', I had not been able to discern from that text what the problem was.  I could not have solved it without your

[R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-27 Thread Mauricio Cornejo
Hi, Would anyone have any idea as to why I would obtain completely different results when subsetting using the subset function vs bracket notation? I have a data frame with 65 variables and 4382 rows. When I use execute the following subset command I get the correct results (125 rows)

[R] How to use access results of gregexpr in data frames

2012-03-30 Thread Mauricio Cornejo
Hello, I'm trying to figure out how to find the index of the second occurrence of / in a string (which happens to represent a date) within a data frame column. I've used the following code successfully to find the first instance of /. dframe - data.frame(date=c(5/14/2011, 4/7/2011)) dframe$x1

Re: [R] How to use access results of gregexpr in data frames

2012-03-30 Thread Mauricio Cornejo
, Mauricio Cornejo Hello, I'm trying to figure out how to find the index of the second occurrence of / in a string (which happens to represent a date) within a data frame column. I've used the following code successfully to find the first instance of /. dframe - data.frame(date=c(5/14/2011

[R] Can 'mosaic' be used with a continuous variable?

2011-09-14 Thread Mauricio Cornejo
Hello, I'm wondering if the 'mosaic' plot of the vcd package (or any other function for that matter) can be used with a continuous variable that should be represented via various categorical variables.  All the documentation I've read lead me to believe that it only works with counts of

Re: [R] Can 'mosaic' be used with a continuous variable?

2011-09-14 Thread Mauricio Cornejo
-project.org r-help@r-project.org Sent: Wednesday, September 14, 2011 1:45 PM Subject: Re: [R] Can 'mosaic' be used with a continuous variable? On Wed, 14 Sep 2011, Mauricio Cornejo wrote: Hello, I'm wondering if the 'mosaic' plot of the vcd package (or any other function for that matter) can

[R] THX-- How to use 'switch' with strings containing spaces?

2011-08-24 Thread Mauricio Cornejo
choice, Choice 2=My 2nd choice, Choice 3=My 3rd choice) [1] My 2nd choice     On Tue, Aug 16, 2011 at 4:53 PM, Mauricio Cornejo mauriciocorn...@yahoo.com wrote: Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces?  Neither

[R] How to use 'switch' with strings containing spaces?

2011-08-16 Thread Mauricio Cornejo
Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces?  Neither of the two approaches below works. switch(expr, Choice 1=My first choice, Choice 2=My 2nd choice, Choice 3=My 3rd choice) x - c(Choice 1, Choice 2, Choice 3)

[R] How to subset based on column name that is a number ?

2011-06-09 Thread Mauricio Cornejo
Hi, I have a data frame with column names 1, 2, 3, ... and I'd like to extract a subset based on the values in the first column. None of the methods I tried worked (below). x - subset(dframe, 1 = = My Text) x - subset(dframe, 1 = = My Text) x - subset(dframe, names(dframe)[1] = = My Text) Q