[R] package ‘contingency.tables’ is not available (for R version 2.15.2)

2013-03-04 Thread Joanna Papakonstantinou
I am trying to create contingency tables (to evaluate prior to performing
Pearson's Chi-Squared test for independence). I would like to see column
and row totals as well as expected and observed values and cell counts.
I tried to use the package contingency. tables but get the following
warning:
 package ‘contingency.tables’ is not available (for R versions 2.15.2)
Is there something comparable or was this replaced with something else for
later versions of R.
Any help would be appreciated so that I may create a contigencey table like
this.

Thank you.

**


*Joanna *

[[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] package ‘contingency.tables’ is not available (for R version 2.15.2)

2013-03-04 Thread Joanna Papakonstantinou
Thank you.
I actually ended up using:

 CrossTable(mdt)

   Cell Contents
|-|
|   N |
| Chi-square contribution |
|   N / Row Total |
|   N / Col Total |
| N / Table Total |
|-|


Total Observations in Table:  8


 |
 |  Blue | Green |   Red | Row Total |
-|---|---|---|---|
   A | 1 | 0 | 1 | 2 |
 | 0.083 | 0.500 | 0.083 |   |
 | 0.500 | 0.000 | 0.500 | 0.250 |
 | 0.333 | 0.000 | 0.333 |   |
 | 0.125 | 0.000 | 0.125 |   |
-|---|---|---|---|
   G | 1 | 0 | 1 | 2 |
 | 0.083 | 0.500 | 0.083 |   |
 | 0.500 | 0.000 | 0.500 | 0.250 |
 | 0.333 | 0.000 | 0.333 |   |
 | 0.125 | 0.000 | 0.125 |   |
-|---|---|---|---|
   H | 1 | 0 | 1 | 2 |
 | 0.083 | 0.500 | 0.083 |   |
 | 0.500 | 0.000 | 0.500 | 0.250 |
 | 0.333 | 0.000 | 0.333 |   |
 | 0.125 | 0.000 | 0.125 |   |
-|---|---|---|---|
   W | 0 | 2 | 0 | 2 |
 | 0.750 | 4.500 | 0.750 |   |
 | 0.000 | 1.000 | 0.000 | 0.250 |
 | 0.000 | 1.000 | 0.000 |   |
 | 0.000 | 0.250 | 0.000 |   |
-|---|---|---|---|
Column Total | 3 | 2 | 3 | 8 |
 | 0.375 | 0.250 | 0.375 |   |
-|---|---|---|---|


and

 expected.counts - (apply(mdt,1,sum) %o% apply(mdt,2,sum))/sum(mdt)

 print(expected.counts)

  Blue Green  Red

A 0.75   0.5 0.75

G 0.75   0.5 0.75

H 0.75   0.5 0.75

W 0.75   0.5 0.75
to get the info I needed.


Regards,
Joanna

On Mon, Mar 4, 2013 at 2:15 PM, Milan Bouchet-Valat nalimi...@club.frwrote:

 Le lundi 04 mars 2013 à 12:37 -0600, Joanna Papakonstantinou a écrit :
  I am trying to create contingency tables (to evaluate prior to performing
  Pearson's Chi-Squared test for independence). I would like to see column
  and row totals as well as expected and observed values and cell counts.
  I tried to use the package contingency. tables but get the following
  warning:
   package contingency.tables is not available (for R versions 2.15.2)
  Is there something comparable or was this replaced with something else
 for
  later versions of R.
  Any help would be appreciated so that I may create a contigencey table
 like
  this.
 I'm not aware of the existence of such a package, but base R provides
 most of what you need, and other packages offer even more. See e.g.
 http://www.statmethods.net/stats/frequencies.html


 Regards




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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] cutreeDynamic error

2013-02-27 Thread Joanna Papakonstantinou
Thank you, Peter.
This worked.
I appreciate your time and help.

Regards,
Joanna

On Wed, Feb 27, 2013 at 1:21 AM, Peter Langfelder 
peter.langfel...@gmail.com wrote:

 On Tue, Feb 26, 2013 at 8:34 AM, Joanna Papakonstantinou
 joanna.p...@gmail.com wrote:
  So I realized I had to convert my dd.daisy to a matrix and used:
  ddmatrix.daisy-as.matrix(dd.daisy)
  and then I passed that in as the distM:
  cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize = 2,
  method = hybrid, distM = ddmatrix.daisy,deepSplit =
  (ifelse(method==hybrid, 1, FALSE)),maxCoreScatter = NULL, minGap =
 NULL,
  maxAbsCoreScatter = NULL, minAbsGap = NULL,useMedoids = FALSE,
  maxDistToLabel = cutHeight,respectSmallClusters = TRUE, verbose = 2,
 indent
  = 0)
 
  However, now I am getting a different error:
 
   Detecting clusters...
  ..cutHeight not given, setting it to 0.847  ===  99% of the (truncated)
  height range in dendro.
  Error in ifelse(method == hybrid, 1, FALSE) : object 'method' not found
 
  Anny suggestions on how to fix this?

 Yes, leave out the 'deepSplit = (ifelse(method==hybrid, 1, FALSE))'
 from the call. This is not really a cutreeDynamic problem, it is a
 perhaps somewhat confusing aspect of R language. If you don't specify
 deepSplit, its default value will be evaluated within the function
 'interior' where the variable 'method' is defined. If you do specify
 deepSplit, the expression that you specify is evaluated from 'outside'
 the function where the variable 'method' is undefined. Thus, the
 seemingly same expression can lead to two different results.

 In fact, you may want to leave out all arguments for which you are
 using a default value, it will make your call shorter and less prone
 to the type of error you just experienced.

 HTH,

 Peter




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.


[R] cutreeDynamic error

2013-02-26 Thread Joanna Papakonstantinou
I am having difficulty getting the dynamic tree cut package to work.

Given the data table myddtable
LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H
Blue23
I created a similarity matrix using DAISY and Gower metric and specified
Place and Color columns as characters (since they are categorical variables)

 dd.daisy-daisy(myddtable, metric = gower, stand = FALSE, type =
list(character=c(Place,Color)))

Then I clustered using DIANA
dd.diana-diana(dd.daisy)
I am trying to cutreeDynamic {dynamicTreeCut} as follows

cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize = 1, method =
hybrid,+ distM = dd.daisy,+ deepSplit =
(ifelse(method==hybrid, 1, FALSE)),+ maxCoreScatter =
NULL, minGap = NULL,+ maxAbsCoreScatter = NULL,
minAbsGap = NULL,+ maxDistToLabel = cutHeight,+
respectSmallClusters = TRUE, + verbose = 2, indent
= 0)

But get the following error:

Warning in if (class(dendro) != hclust) stop(Argument dendro must
have class hclust.) :
the condition has length  1 and only the first element will be
usedError in cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize =
1, method = hybrid, :
Argument dendro must have class hclust.

Is this trying to tell me I cannot use this with DIANA but only with hclust
because I thought it could be used with any of the hierarchical methods?

I hope someone can please tell me what I am doing wrong.

Thank you.


-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.


[R] cutreeDynamic error

2013-02-26 Thread Joanna Papakonstantinou
So I realized I had to convert my dd.daisy to a matrix and used:
ddmatrix.daisy-as.matrix(dd.daisy)
and then I passed that in as the distM:
 cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize = 2,
method = hybrid, distM = ddmatrix.daisy,deepSplit =
(ifelse(method==hybrid, 1, FALSE)),maxCoreScatter = NULL, minGap = NULL,
maxAbsCoreScatter = NULL, minAbsGap = NULL,useMedoids = FALSE,
maxDistToLabel = cutHeight,respectSmallClusters = TRUE, verbose = 2, indent
= 0)

However, now I am getting a different error:

 Detecting clusters...
..cutHeight not given, setting it to 0.847  ===  99% of the (truncated)
height range in dendro.
Error in ifelse(method == hybrid, 1, FALSE) : object 'method' not found

Anny suggestions on how to fix this?

Joanna

[[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] How to define variables as categorical using Gower with Daisy

2013-02-25 Thread Joanna Papakonstantinou
Thank you for pointing me to ?dissimilarity.object. I now see that N = Nominal
(factor) and I = Interval scaled (numeric).

Regards.


On Sun, Feb 24, 2013 at 2:36 PM, Peter Ehlers ehl...@ucalgary.ca wrote:

 On 2013-02-24 07:57, Joanna Papakonstantinou wrote:

 I am using the iris dataset that contains mixed variables (some columns
 are numeric and some categorical).

  iris

  Sepal.Length Sepal.Width Petal.Length Petal.WidthSpecies
 15.1 3.5  1.4 0.2 setosa
 24.9 3.0  1.4 0.2 setosa
 34.7 3.2  1.3 0.2 setosa
 44.6 3.1  1.5 0.2 setosa
 .
 .
 .


  I am trying to use the Gower metric so that I may specify that some
 columns contain categorical data.

 iris.clust-daisy(iris, metric = gower, stand = FALSE, type =
 list(factor=Species))

 But it is saying that the types= I, I, I, I, N
 so obviously it is not reading the variable types correctly.


 I don't know why you say that. Look at ?dissimilarity.object to see
 what 'I' and 'N' mean.

 If you read the help page for ?daisy carefully, you'll see that your
 command is equivalent to

   iris.clust(iris)

 i.e. you need not specify the metric etc.
 BTW, your specification of 'type' indicates that you may have
 looked at the help page a bit too hastily.



 Could someone please tell me how to specify the variable types correctly?

 Thank you.
 Joanna


 Peter Ehlers




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.


[R] Argument dendro must have class hclust - cutreeDynamic error

2013-02-25 Thread Joanna Papakonstantinou
I am having difficulty getting the dynamic tree cut package to work.

Given the data table myddtable
LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H
Blue23
I created a similarity matrix using DAISY and Gower metric and specified
Place and Color columns as characters (since they are categorical variables)

 dd.daisy-daisy(myddtable, metric = gower, stand = FALSE, type =
list(character=c(Place,Color)))

Then I clustered using DIANA
dd.diana-diana(dd.daisy)
I am trying to cutreeDynamic {dynamicTreeCut} as follows

cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize = 1, method =
hybrid,+   distM = dd.daisy,+   deepSplit =
(ifelse(method==hybrid, 1, FALSE)),+   maxCoreScatter =
NULL, minGap = NULL,+   maxAbsCoreScatter = NULL,
minAbsGap = NULL,+   maxDistToLabel = cutHeight,+
 respectSmallClusters = TRUE, +   verbose = 2, indent
= 0)

But get the following error:

Warning in if (class(dendro) != hclust) stop(Argument dendro must
have class hclust.) :
  the condition has length  1 and only the first element will be
usedError in cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize =
1, method = hybrid,  :
  Argument dendro must have class hclust.


Is this trying to tell me I cannot use this with DIANA but only with hclust?

Please tell me what I am doing wrong.

Thank you.


*Joanna *

[[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.


[R] How to define variables as categorical using Gower with Daisy

2013-02-24 Thread Joanna Papakonstantinou
 I am using the iris dataset that contains mixed variables (some columns are 
 numeric and some categorical).
  
  iris
 Sepal.Length Sepal.Width Petal.Length Petal.WidthSpecies
 15.1 3.5  1.4 0.2 setosa
 24.9 3.0  1.4 0.2 setosa
 34.7 3.2  1.3 0.2 setosa
 44.6 3.1  1.5 0.2 setosa
 .
 .
 .

 I am trying to use the Gower metric so that I may specify that some columns 
 contain categorical data.
  iris.clust-daisy(iris, metric = gower, stand = FALSE, type = 
  list(factor=Species))
But it is saying that the types= I, I, I, I, N
so obviously it is not reading the variable types correctly.

Could someone please tell me how to specify the variable types correctly?

Thank you.
Joanna



 

[[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.


[R] Fwd: difficulty defining variables as categorical using Gower with DAISY

2013-02-22 Thread Joanna Papakonstantinou

 I am using the iris dataset that contains mixed variables (some columns are 
 numeric and some categorical).
  
 
  iris
 Sepal.Length Sepal.Width Petal.Length Petal.WidthSpecies
 15.1 3.5  1.4 0.2 setosa
 24.9 3.0  1.4 0.2 setosa
 34.7 3.2  1.3 0.2 setosa
 44.6 3.1  1.5 0.2 setosa
 .
 .
 .

 I am trying to use the Gower metric so that I may specify that some columns 
 contain categorical data.
  iris.clust-daisy(iris, metric = gower, stand = FALSE, type = 
  list(factor=Species))
 
But it is saying that the type= I, I, I, I, N
so obviously it is not reading the variable types correctly.

Could someone please tell me how to specify the types correctly?

Thank you.
  
 **
  
 Joanna Papakonstantinou, Ph.D.
 

[[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] Error in setwd(outDir) : cannot change working directory

2013-02-21 Thread Joanna Papakonstantinou
I only thought one was missing since it kept giving me error that it wasn't
set. But all seems to working OK so I guess I don't need to create anything.

Thank you for your help.

On Wed, Feb 20, 2013 at 7:28 PM, S Ellison s.elli...@lgcgroup.com wrote:



  Should I create an output directory somewhere either in Program Files
 where
  R is installed or in my working directory?
 If I wanted to create a writeable test directory I'd put it in my own
 workspace, not the program files space.
 But why do you think you need to create an output directory?

   ***
 This email and any attachments are confidential. Any u...{{dropped:20}}

__
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] duplicate 'row.names' are not allowed

2013-02-21 Thread Joanna Papakonstantinou
Thank you. I ended up converting the excel file to a csv file and using
mytable-read.csv(myfile, header=T)
and it worked so I abandoned using the tab delimited txt file.

On Wed, Feb 20, 2013 at 9:29 PM, Jim Lemon j...@bitwrit.com.au wrote:

 On 02/21/2013 07:10 AM, Joanna Papakonstantinou wrote:

 Some of the names in the columns actually have spaces in them (e.g., S L
 TX
 is in one column). So there are really 9.
 I was able to save the file as a csv file and read.table succesfully.

  Hi Joanna,
 As you specified space ( ) as the field delimiter in your initial post,
 fields with spaces would be read as multiple fields, forcing the first
 column to be read as row names. I suspect that you changed the delimiter or
 that read.csv treats this differently from read.delim. I recall having to
 specify something about row names with read.delim once.

 Jim




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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] Error in setwd(outDir) : cannot change working directory

2013-02-21 Thread Joanna Papakonstantinou
Below is what happened when I ran
 testInstalledPackages(scope=base,errorsAreFatal=FALSE) Testing examples
for package ‘base’ comparing ‘base-Ex.Rout’ to ‘base-Ex.Rout.prev’
...files differ in number of lines: Testing
examples for package ‘tools’ comparing ‘tools-Ex.Rout’ to
‘tools-Ex.Rout.save’ ... 474c474  [1] Matrix nlme vegan mgcv --- 
[1] Matrix nlme mgcv 619c619  [1] 0cce1e42ef3fb133940946534fcf8896
---  [1] eb723b61539feef013de476e68b5c50a 844c844  [1] R (= 2.15.1)
---  [1] R (= 2.14.0) Running specific tests for package ‘tools’ Running
‘undoc.R’ Testing examples for package ‘utils’ comparing ‘utils-Ex.Rout’ to
‘utils-Ex.Rout.prev’ ... files differ in number of lines: Running specific
tests for package ‘utils’ Running ‘Sweave-tst.R’ Warning: running command
'C:/PROGRA~1/R/R-215~1.2/bin/x64/R CMD BATCH --vanilla --no-timing
Sweave-tst.R Sweave-tst.Rout LANGUAGE=C' had status 1 Warning: testing
'utils' failed Testing examples for package ‘grDevices’ comparing
‘grDevices-Ex.Rout’ to ‘grDevices-Ex.Rout.save’ ... OK Running specific
tests for package ‘grDevices’ Running ‘ps-tests.R’ comparing
‘ps-tests.Rout’ to ‘ps-tests.Rout.save’ ... OK Running ‘xfig-tests.R’ comparing
‘xfig-tests.Rout’ to ‘xfig-tests.Rout.save’ ... OK Testing examples for
package ‘graphics’ comparing ‘graphics-Ex.Rout’ to ‘graphics-Ex.Rout.save’
... OK Testing examples for package ‘stats’ comparing ‘stats-Ex.Rout’ to
‘stats-Ex.Rout.save’ ... OK Running specific tests for package ‘stats’ Running
‘NLSstClosest.R’ Running ‘cmdscale.R’ Running ‘drop1-polr.R’ Running
‘ig_glm.R’ Running ‘ks-test.R’ comparing ‘ks-test.Rout’ to
‘ks-test.Rout.save’ ... OK Running ‘nafns.R’ Running ‘nls.R’ comparing
‘nls.Rout’ to ‘nls.Rout.save’ ... OK Running ‘offsets.R’ Running
‘ppr.R’ Running
‘simulate.R’ comparing ‘simulate.Rout’ to ‘simulate.Rout.save’ ... OK Running
‘smooth.spline.R’ Running ‘ts-tests.R’ Testing examples for package
‘datasets’ comparing ‘datasets-Ex.Rout’ to ‘datasets-Ex.Rout.save’ ...
OK Testing
examples for package ‘methods’ comparing ‘methods-Ex.Rout’ to
‘methods-Ex.Rout.prev’ ... OK Running specific tests for package
‘methods’ Running
‘S3.R’ Running ‘basicRefClass.R’ Running ‘duplicateClass.R’ Running
‘fieldAssignments.R’ Running ‘mixinInitialize.R’ Running
‘namesAndSlots.R’ Running
‘nextWithDots.R’ Running ‘refClassExample.R’ Running
‘testConditionalIs.R’ Running
‘testGroupGeneric.R’ Running ‘testIs.R’ Testing examples for package
‘grid’ comparing
‘grid-Ex.Rout’ to ‘grid-Ex.Rout.save’ ... OK Running specific tests for
package ‘grid’ Running ‘bugs.R’ Running ‘reg.R’ Running ‘testls.R’ comparing
‘testls.Rout’ to ‘testls.Rout.save’ ... OK Running ‘units.R’ Running
vignettes for package ‘grid’ Testing examples for package ‘splines’ comparing
‘splines-Ex.Rout’ to ‘splines-Ex.Rout.save’ ... OK Testing examples for
package ‘stats4’ comparing ‘stats4-Ex.Rout’ to ‘stats4-Ex.Rout.save’
... OK Running
specific tests for package ‘stats4’ Running ‘confint.R’ Testing examples
for package ‘tcltk’ comparing ‘tcltk-Ex.Rout’ to ‘tcltk-Ex.Rout.prev’
...OK Testing
examples for package ‘compiler’ comparing ‘compiler-Ex.Rout’ to
‘compiler-Ex.Rout.prev’ ... OK Running specific tests for package
‘compiler’ Running ‘assign.R’ Running ‘basics.R’ Running ‘const.R’ Running
‘envir.R’ Running ‘jit.R’ Running ‘loop.R’ Running ‘switch.R’ Testing
examples for package ‘parallel’ comparing ‘parallel-Ex.Rout’ to
‘parallel-Ex.Rout.prev’ ... OK Running specific tests for package
‘parallel’ Running ‘Master.R’ Running vignettes for package ‘parallel’
I do not really know what any of this means but when I got a graph and no
explicit errors returned I just wnet ahead with using the installation. I
have not encountered anything wrong while using is so unless there is
something you can tell from the above, I guess I will just continue to use
the current installation.

Many thanks.

On Thu, Feb 21, 2013 at 2:36 PM, Gabor Grothendieck ggrothendi...@gmail.com
 wrote:

 On Thu, Feb 21, 2013 at 10:46 AM, Joanna Papakonstantinou
 joanna.p...@gmail.com wrote:
  I only thought one was missing since it kept giving me error that it
 wasn't
  set. But all seems to working OK so I guess I don't need to create
 anything.
 

 No. The first two gave a response of 1 which means they failed.




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.


[R] Error in setwd(outDir) : cannot change working directory

2013-02-20 Thread Joanna Papakonstantinou
I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2

and am able to open RGUI  (640bit), see packages and run commands. However,
when I test the installation and run the basic tests and all the tests on
the standard and recommended packages i.e.:

  library(tools)

  testInstalledBasic(both)

  testInstalledPackages(base, errorsAreFatal = FALSE)

  testInstalledPackages(recommended, errorsAreFatal = FALSE)



I am getting errors such as:

  testInstalledPackages(base,errorsAreFatal=FALSE)

 Error in setwd(outDir) : cannot change working directory



my working driectory is:

getwd()

[1] C:/Users/jpapa/Documents
 In which I see R folder as well as the .rData from my last session.

what does the wd have to do with the output directory? Do  I need to create
an output directory? DO I need to setwd(outDir)?

do i need to change the wd (for example to the Pogram Files directory where
R is installed or to another directory I need to create? if so, how do I do
this?





i also noticed that i have packages in

\library ‘C:/Users/jpapa/Documents/R/win-library/2.15’

and in library ‘C:/Program Files/R/R-2.15.2/library’.

Do all packages need to be in one place? If so, should they be in my
Documents or in Program Files?



Thank you for your help.



**


*Joanna Papakonstantinou, Ph.D.*

[[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] Error in setwd(outDir) : cannot change working directory

2013-02-20 Thread Joanna Papakonstantinou
I am running as administrator.

Again, the first 2 tests worked but the 3rd is still giving me an error:
 testInstalledBasic(basic)
running strict specific tests
  running code in ‘eval-etc.R’
  comparing ‘eval-etc.Rout’ to ‘eval-etc.Rout.save’ ...[1] 1
 testInstalledBasic(both)
running strict specific tests
  running code in ‘eval-etc.R’
  comparing ‘eval-etc.Rout’ to ‘eval-etc.Rout.save’ ...[1] 1
 testInstalledPackages(base,errorsAreFatal=FALSE)
Error in setwd(outDir) : cannot change working directory


So since this my installation was standard, do you just recommend I
unistall and resintsall somewhere else?

Thank you for your help.


On Wed, Feb 20, 2013 at 11:33 AM, Gabor Grothendieck 
ggrothendi...@gmail.com wrote:

 On Wed, Feb 20, 2013 at 11:54 AM, Joanna Papakonstantinou
 joanna.p...@gmail.com wrote:
  I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2
 
  and am able to open RGUI  (640bit), see packages and run commands.
 However,
  when I test the installation and run the basic tests and all the tests on
  the standard and recommended packages i.e.:
 
library(tools)
 
testInstalledBasic(both)
 
testInstalledPackages(base, errorsAreFatal = FALSE)
 
testInstalledPackages(recommended, errorsAreFatal = FALSE)
 
 
 
  I am getting errors such as:
 
testInstalledPackages(base,errorsAreFatal=FALSE)
 
   Error in setwd(outDir) : cannot change working directory
 
 
 
  my working driectory is:
 
 getwd()
 
  [1] C:/Users/jpapa/Documents
   In which I see R folder as well as the .rData from my last session.
 
  what does the wd have to do with the output directory? Do  I need to
 create
  an output directory? DO I need to setwd(outDir)?
 
  do i need to change the wd (for example to the Pogram Files directory
 where
  R is installed or to another directory I need to create? if so, how do I
 do
  this?
 
 
 
 
 
  i also noticed that i have packages in
 
  \library ‘C:/Users/jpapa/Documents/R/win-library/2.15’
 
  and in library ‘C:/Program Files/R/R-2.15.2/library’.
 
  Do all packages need to be in one place? If so, should they be in my
  Documents or in Program Files?

 Its likely trying to write in the C:\Program Files tree but lacks
 permission. Run R with Administrator permissions or re-install R
 elsewhere, e.g. C:\R

 --
 Statistics  Software Consulting
 GKX Group, GKX Associates Inc.
 tel: 1-877-GKX-GROUP
 email: ggrothendieck at gmail.com




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.


[R] duplicate 'row.names' are not allowed

2013-02-20 Thread Joanna Papakonstantinou
I am getting an error when trying to import tab delimited .txt file saved
from Excel.
I have read what is posted on the forums but still am confused.

I saved my Excel file (DataTestforR.xlsx) as a tab delimited txt file
(DataTestR.txt) on my Desktop.
In the RGUI, I tried to import the txt file and got an error

 myfile-C:\\Users\\jpapa\\Desktop\\DataTestR.txt
 mydf-read.delim(myfile, header=TRUE,sep= , dec=.)
Error in read.table(file = file, header = header, sep = sep, quote =
quote,  :
  duplicate 'row.names' are not allowed

The first row of my file has column names and the first column of my file
has unique identifing names (not duplicated):
Cu Sa Na Ci Se NM NPI IPI Seg
0090.00 15.48 1 SOM S L TX 0 0.2 0.2 7-Very
10997.00 64.62 123 B C NJ 0 0.01 0.04 7-Very

Please tell me what I am doing wrong.

Thank you.
**


*Joanna Papakonstantinou, Ph.D.*

[[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] Error in setwd(outDir) : cannot change working directory

2013-02-20 Thread Joanna Papakonstantinou
I ran
testInstalledPackages(scope=base,errorsAreFatal=FALSE)
and it completed (and spit out a graph).

Does this mean I am ok to contunie using this installation of R?
Should I create an output directory somewhere either in Program Files where
R is installed or in my working directory?
Thank you for your time and help.

On Wed, Feb 20, 2013 at 12:20 PM, S Ellison s.elli...@lgcgroup.com wrote:



  I am getting errors such as:
   testInstalledPackages(base,errorsAreFatal=FALSE)
 
   Error in setwd(outDir) : cannot change working directory

 Er, the first parameter in  testInstalledPackages() is the output
 directory name, not the package name supplied in scope. You probably don;t
 have a writeable directory called base

 Try
  testInstalledPackages(scope=base,errorsAreFatal=FALSE)

 S Ellison

 ***
 This email and any attachments are confidential. Any u...{{dropped:20}}

__
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] duplicate 'row.names' are not allowed

2013-02-20 Thread Joanna Papakonstantinou
Some of the names in the columns actually have spaces in them (e.g., S L TX
is in one column). So there are really 9.
I was able to save the file as a csv file and read.table succesfully.

On Wed, Feb 20, 2013 at 2:03 PM, David Winsemius dwinsem...@comcast.netwrote:


 On Feb 20, 2013, at 10:14 AM, Joanna Papakonstantinou wrote:

  I am getting an error when trying to import tab delimited .txt file saved
  from Excel.
  I have read what is posted on the forums but still am confused.
 
  I saved my Excel file (DataTestforR.xlsx) as a tab delimited txt file
  (DataTestR.txt) on my Desktop.
  In the RGUI, I tried to import the txt file and got an error
 
  myfile-C:\\Users\\jpapa\\Desktop\\DataTestR.txt
  mydf-read.delim(myfile, header=TRUE,sep= , dec=.)
  Error in read.table(file = file, header = header, sep = sep, quote =
  quote,  :
   duplicate 'row.names' are not allowed
 
  The first row of my file has column names and the first column of my file
  has unique identifing names (not duplicated):
  Cu Sa Na Ci Se NM NPI IPI Seg
  0090.00 15.48 1 SOM S L TX 0 0.2 0.2 7-Very

 I count 11 data columns and nine column names.

 --
 Alameda, CA, USA




-- 
**


*Joanna Papakonstantinou, Ph.D.*

[[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.