[R] problem with read.table()

2008-07-30 Thread Birgitle

Hello R-User

I have a table as tab-delimited textfile (291 rows, 83 columns).
The first row are labels and the first line the variable names.

I used the following code several times with different similar tables and it
always worked.
But now:

   setClass("of")
   setAs("character", "of", function(from) as.ordered(from))

  Classe82<-cclasses <- c(rep("factor", 63),  rep("numeric",7), rep ("of",
12))
  Table<-read.table("Table.txt",header=TRUE,row.names=1, na.strings="NA"
,colClasses = Classe82)

I get this error-message:

  Fehler in scan(file, what, nmax, sep, dec, quote, skip, nlines,
na.strings,  : 
  scan() erwartete 'a real', bekam '8,5'

  Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, 
: 
  scan()  expected 'a real', got '8,5'

It seems that the error is in the colClasses-argument. Without this argument
it reads the table.
I checked allready if there are empty cells or blanks in the header but
could not find.
Maybe that its just a simple thing and I know that I can change the classes
after reading in the table, but I really would like to know how to do this
right.

I would be very glad if somebody has an idea, or could tell me, how I could
find out, what`s going wrong.

Many thanks in advance

B.

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/problem-with-read.table%28%29-tp18729348p18729348.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] problem with read.table()

2008-07-30 Thread Birgitle

I am sorry I just found the stupid mistake.

I did not specify dec="," because I usually use . 

Anyway thanks for having the opportunity to get help in this list.

B.


Birgitle wrote:
> 
> Hello R-User
> 
> I have a table as tab-delimited textfile (291 rows, 83 columns).
> The first row are labels and the first line the variable names.
> 
> I used the following code several times with different similar tables and
> it always worked.
> But now:
> 
>setClass("of")
>setAs("character", "of", function(from) as.ordered(from))
> 
>   Classe82<-cclasses <- c(rep("factor", 63),  rep("numeric",7), rep ("of",
> 12))
>   Table<-read.table("Table.txt",header=TRUE,row.names=1, na.strings="NA"
> ,colClasses = Classe82)
> 
> I get this error-message:
> 
>   Fehler in scan(file, what, nmax, sep, dec, quote, skip, nlines,
> na.strings,  : 
>   scan() erwartete 'a real', bekam '8,5'
> 
>   Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
> na.strings,  : 
>   scan()  expected 'a real', got '8,5'
> 
> It seems that the error is in the colClasses-argument. Without this
> argument it reads the table.
> I checked allready if there are empty cells or blanks in the header but
> could not find.
> Maybe that its just a simple thing and I know that I can change the
> classes after reading in the table, but I really would like to know how to
> do this right.
> 
> I would be very glad if somebody has an idea, or could tell me, how I
> could find out, what`s going wrong.
> 
> Many thanks in advance
> 
> B.
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/problem-with-read.table%28%29-tp18729348p18729917.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.


[R] glm error: factor levels

2008-07-30 Thread Birgitle

Hello R-Users, again me!

I have a data.frame with 291 rows, 82 columns. 
Tha variables in the columns are factors, numerics and ordered factors.

The response variable is a factor with two levels.

I would like to find the best model by trying every possible variable
combination using a logistic regression and comparing the AIC (still have to
find out how to do this fast and easy).
I am aware of the step function but would like to do it also without step.

But unfortunatley I have allready a problem with the first model using all
variables:

   df.glm<-glm(RespVar~.,family="binomial",data=df)

I get back this:

   Fehler in `contrasts<-`(`*tmp*`, value = "contr.treatment") : 
   Kontraste können nur auf Faktoren mit 2 oder mehr Stufen angewendet
werden

   Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
   contrasts can only be used for factors with two or more levels

There are no variables with less than two levels in my data.frame but here
are missing values (NA).
I could imagine that some observations are deleted due to missingness and
perhaps after that, some of the variables contain only one level.

I would be happy if somebody could tell me if my speculation could be true
and perhaps also how I could find out which variables I have to delete to
avoid this problem.

Many thanks in advance.

B.


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/glm-error%3A-factor-levels-tp18730487p18730487.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.


[R] Sperman Correlation with rcorr (Hmisc)

2008-07-31 Thread Birgitle

Hello R-User!

I have a data.frame with 82 variables (columns) and 290 rows.
The variables are set to classes factor, ordered factor and numeric.

I used the following code

 Matrix.My.data<-as.matrix(Df.My.Data[2:82])
 Matrix.My.data.rcorr<-rcorr(Matrix.My.data, type="spearman")

and got the following message:

Fehler in storage.mode(x) <- if (.R.) "double" else "single" : 
  (list) Objekt kann nicht nach 'double' umgewandelt werden

Error Fehler in storage.mode(x) <- if (.R.) "double" else "single" :
 (list) object can not be altered into 'double'.

Can somebody tell me what is going wrong with my code?

Many thanks in advance.

B.




-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Sperman-Correlation-with-rcorr-%28Hmisc%29-tp18758029p18758029.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.


[R] Correlation dichotomous factor, continous (numerical) and ordered factor

2008-08-06 Thread Birgitle

Hello R-User!

I appologise in advance if this should also go into statistics but I am
presently puzzled.
I have a data.frame (about 300 rows and about 80 variables) and my variables
are dichotomous factors, continuous (numerical) and ordered factors.

I would like to calculate the linear correlation between every pair of my
variables, because I would like to perform a logistic regression (glm())
without the correlation between variables.

I thought I could use for the continous (numerical) and ordered factor a
spearman correlation that is using the ranks.

But I thought also that I have to use a contingency table for the
dichotomous factors. 

I read also that it is possible to use a point-biserial correlation to
calculate the correlation between dichotomous and continuous variables.

Now I am confused what I should use to calculate the correlation using all
my variables and how I could do that in R.
Is it possible with cor(), rcorr(), cormat() or other R-functions using one
of the available correlation-coefficients.

I would be very happy if somebody could enlighten my darkness.

Many thanks in advance.

B.


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Correlation-dichotomous-factor%2C-continous-%28numerical%29-and-ordered-factor-tp18852158p18852158.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] Correlation dichotomous factor, continous (numerical) and ordered factor

2008-08-06 Thread Birgitle

Many, many thanks that was fast and exactly what I was looking for.

B.


Mark Difford wrote:
> 
> Hi Birgitle,
> 
>>> ... my variables are dichotomous factors, continuous (numerical) and
>>> ordered factors. ...
>>> Now I am confused what I should use to calculate the correlation using
>>> all my variables
>>> and how I could do that in R.
> 
> Professor Fox's package polycor will do this for you in a very nice way.
> 
> Regards, Mark.
> 
> 
> Birgitle wrote:
>> 
>> Hello R-User!
>> 
>> I appologise in advance if this should also go into statistics but I am
>> presently puzzled.
>> I have a data.frame (about 300 rows and about 80 variables) and my
>> variables are dichotomous factors, continuous (numerical) and ordered
>> factors.
>> 
>> I would like to calculate the linear correlation between every pair of my
>> variables, because I would like to perform a logistic regression (glm())
>> without the correlation between variables.
>> 
>> I thought I could use for the continous (numerical) and ordered factor a
>> spearman correlation that is using the ranks.
>> 
>> But I thought also that I have to use a contingency table for the
>> dichotomous factors. 
>> 
>> I read also that it is possible to use a point-biserial correlation to
>> calculate the correlation between dichotomous and continuous variables.
>> 
>> Now I am confused what I should use to calculate the correlation using
>> all my variables and how I could do that in R.
>> Is it possible with cor(), rcorr(), cormat() or other R-functions using
>> one of the available correlation-coefficients.
>> 
>> I would be very happy if somebody could enlighten my darkness.
>> 
>> Many thanks in advance.
>> 
>> B.
>> 
>> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Correlation-dichotomous-factor%2C-continous-%28numerical%29-and-ordered-factor-tp18852158p18852945.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.


[R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle

Sorry if this post should be long but I tried to give you a piece of my data
to reproduce my error message using hetcor:

Fehler in result$rho : $ operator is invalid for atomic vectors
Zusätzlich: Warning messages:
1: In polychor(x, y, ML = ML, std.err = std.err) :
  1 row with zero marginal removed
2: In polychor(x, y, ML = ML, std.err = std.err) :
  the table has fewer than 2 rows


Error in result$rho : $ operator is invalid for atomic vectors
Additional: Warning message:
1: In polychor(x, y, ML = ML, std.err = std.err) :
  1 row with zero marginal removed
2: In polychor(x, y, ML = ML, std.err = std.err) :
  the table has fewer than 2 rows

Use tab delimited data at the end of the post.
Copy in Texteditor and save as TestPart.txt 

Then use the following code

library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from)) 

Classe81<-cclasses <- c(rep("factor", 64),  rep("numeric",6), rep ("of",
12))

TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
na.strings="NA" ,colClasses = Classe81)

str(TestPart)

library(polycor)

TestPart.hetcor<-hetcor(TestPart, use="complete.obs")

this will produce the above mentioned error message that I can not
interprete.

Would be great if somebody could help me to solve the problem.

Thanks

B.




1   2   3   4   7   8   9   10  12  
13  14  15  16  17  18  19  21  22  23  
25  27  28  29  30  31  33  34
35  36  37  38  39  40  41  42  43  44  
45  46  47  48  49  50  51  52  53  54  
55  56  58  59  60
61  62  63  64  65  66  67  68  69  70  
71  72  73  74  75  76  77  78  79  80
AX  1   1   0   0   1   0   0   1   0   
0   0   0   0   0   0   1   0   1   0   
0   1   1   0   0   0   0   0   1   0   
0   0   1   0   0   0   0   0
1   0   0   0   0   0   0   0   0   0   
1   1   0   0   1   0   1   25  5   9   
1   8.5 2.5 3   5   2   2   3   3   1   
1   1   2   1   2
BX  1   1   0   0   1   0   0   1   NA  
NA  NA  0   0   0   0   1   0   0   1   
0   0   1   0   NA  NA  NA  NA  NA  NA  
NA  NA
0   0   0   1   0   NA  NA  NA  NA  NA  
NA  NA  0   0   0   0   1   1   0   0   
0   1   1   NA  NA  6   1   3.252.255   
5
2   2   3   3   1   1   1   1   1   1
CX  1   1   0   0   1   0   0   1   1   
0   0   0   1   0   1   0   0   1   0   
1   0   0   0   0   1   1   0   0   0   
0   0   0   1   0   0   0   0
1   0   0   0   0   0   0   0   0   1   
0   0   0   0   1   0   0   15  3.5 6   
1   5.5 5.5 5   5   2   2   1   2   1   
1   1   1   2   2
DX  1   1   0   0   1   0   0   1   0   
0   0   0   0   0   0   1   0   0   1   
0   0   1   0   0   1   0   1   0   0   
0   1   0   0   0   0   1   1
0   0   0   0   0   0   0   0   0   1   
0   1   0   1   0   1   0   50  17.57.5 
2.5 8.5 5   5   5   2   2   2   3   1   
1   1   1
3   3
EX  1   0   1   0   1   0   0   1   NA  
NA  NA  0   0   0   1   1   0   1   1   
0   1   0   0   0   0   0   0   1   0   
0   0   0   1   0   0
0   0   0   0   0   1   0   0   0   0   
0   1   0   1   0   0   0   1   0   NA  
NA  14.530  13  2.5 3   3   1   1   4   
4   1   1   1
1   1   1
FX  1   0   1   0   1   0   0   1   0   
0   0   0   0   0   0   1   0   0   1   
0   1   0   0   0   1   1   1   0   0   
1   1   

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle

Thanks Mark and I am sorry that I forgot to adapt the Classe-vector.

This should work now

library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from))

Classe72<-cclasses <- c(rep("factor", 55),  rep("numeric",6), rep ("factor",
12))

TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
na.strings="NA" ,colClasses = Classe72)

library(polycor)

TestPart.hetcor<-hetcor(TestPart, use="complete.obs")

Mark Difford wrote:
> 
> Hi Birgitle,
> 
> You need to get this right if someone is going to spend their time helping
> you. Your code doesn't work: You have specified more columns in colClasses
> than you have in the provided data set.
> 
>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>> na.strings="NA" ,colClasses = Classe81)
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, 
> : 
>   line 1 did not have 82 elements
> 
>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>> na.strings="NA")
> Warning message:
> In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
>   number of items read is not a multiple of the number of columns
> 
>> length(names(TestPart))
> [1] 72
> 
>> length(Classe81)
> [1] 82
> 
> That will never work.
> 
> HTH, Mark.
> 
> 
> Birgitle wrote:
>> 
>> Sorry if this post should be long but I tried to give you a piece of my
>> data to reproduce my error message using hetcor:
>> 
>> Fehler in result$rho : $ operator is invalid for atomic vectors
>> Zusätzlich: Warning messages:
>> 1: In polychor(x, y, ML = ML, std.err = std.err) :
>>   1 row with zero marginal removed
>> 2: In polychor(x, y, ML = ML, std.err = std.err) :
>>   the table has fewer than 2 rows
>> 
>> 
>> Error in result$rho : $ operator is invalid for atomic vectors
>> Additional: Warning message:
>> 1: In polychor(x, y, ML = ML, std.err = std.err) :
>>   1 row with zero marginal removed
>> 2: In polychor(x, y, ML = ML, std.err = std.err) :
>>   the table has fewer than 2 rows
>> 
>> Use tab delimited data at the end of the post.
>> Copy in Texteditor and save as TestPart.txt 
>> 
>> Then use the following code
>> 
>> library(methods)
>> setClass("of")
>> setAs("character", "of", function(from) as.ordered(from)) 
>> 
>> Classe81<-cclasses <- c(rep("factor", 64),  rep("numeric",6), rep ("of",
>> 12))
>> 
>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>> na.strings="NA" ,colClasses = Classe81)
>> 
>> str(TestPart)
>> 
>> library(polycor)
>> 
>> TestPart.hetcor<-hetcor(TestPart, use="complete.obs")
>> 
>> this will produce the above mentioned error message that I can not
>> interprete.
>> 
>> Would be great if somebody could help me to solve the problem.
>> 
>> Thanks
>> 
>> B.
>> 
>> 
>> 
>> 
>>  1   2   3   4   7   8   9   10  12  
>> 13  14  15  16  17  18  19  21  22  23   
>>25  27  28  29  30  31  33
>> 34   35  36  37  38  39  40  41  42  43  
>> 44  45  46  47  48  49  50  51  52  53   
>>54  55  56  58
>> 59   60  61  62  63  64  65  66  67  68  
>> 69  70  71  72  73  74  75  76  77  78   
>>79  80
>> AX   1   1   0   0   1   0   0   1   0   
>> 0   0   0   0   0   0   1   0   1   0
>>0   1   1   0   0   0   0   0   1   0 
>>   0   0   1   0   0   0
>> 00   1   0   0   0   0   0   0   0   
>> 0   0   1   1   0   0   1   0   1   25   
>>5   9   1   8.5 2.5 3   5   2   2   3 
>>   3   1   1   1
>> 21   2
>> BX   1   1   0   0   1   0   0   1   NA  
>> NA  NA  0   0   0   0   1   0   0   1
>>0   0   1   0   NA  NA  NA  NA  NA  
>> NA  NA

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle

I am so sorry there was a little mistake in the code again.

Right code now:

library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from))

Classe72<-cclasses <- c(rep("factor", 55),  rep("numeric",6), rep ("of",
12))

TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
na.strings="NA" ,colClasses = Classe72)

library(polycor)

TestPart.hetcor<-hetcor(TestPart, use="complete.obs")

B.


Birgitle wrote:
> 
> Thanks Mark and I am sorry that I forgot to adapt the Classe-vector.
> 
> This should work now
> 
> library(methods)
> setClass("of")
> setAs("character", "of", function(from) as.ordered(from))
> 
> Classe72<-cclasses <- c(rep("factor", 55),  rep("numeric",6), rep
> ("factor", 12))
> 
> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
> na.strings="NA" ,colClasses = Classe72)
> 
> library(polycor)
> 
> TestPart.hetcor<-hetcor(TestPart, use="complete.obs")
> 
> Mark Difford wrote:
>> 
>> Hi Birgitle,
>> 
>> You need to get this right if someone is going to spend their time
>> helping you. Your code doesn't work: You have specified more columns in
>> colClasses than you have in the provided data set.
>> 
>>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>>> na.strings="NA" ,colClasses = Classe81)
>> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
>> na.strings,  : 
>>   line 1 did not have 82 elements
>> 
>>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>>> na.strings="NA")
>> Warning message:
>> In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
>>   number of items read is not a multiple of the number of columns
>> 
>>> length(names(TestPart))
>> [1] 72
>> 
>>> length(Classe81)
>> [1] 82
>> 
>> That will never work.
>> 
>> HTH, Mark.
>> 
>> 
>> Birgitle wrote:
>>> 
>>> Sorry if this post should be long but I tried to give you a piece of my
>>> data to reproduce my error message using hetcor:
>>> 
>>> Fehler in result$rho : $ operator is invalid for atomic vectors
>>> Zusätzlich: Warning messages:
>>> 1: In polychor(x, y, ML = ML, std.err = std.err) :
>>>   1 row with zero marginal removed
>>> 2: In polychor(x, y, ML = ML, std.err = std.err) :
>>>   the table has fewer than 2 rows
>>> 
>>> 
>>> Error in result$rho : $ operator is invalid for atomic vectors
>>> Additional: Warning message:
>>> 1: In polychor(x, y, ML = ML, std.err = std.err) :
>>>   1 row with zero marginal removed
>>> 2: In polychor(x, y, ML = ML, std.err = std.err) :
>>>   the table has fewer than 2 rows
>>> 
>>> Use tab delimited data at the end of the post.
>>> Copy in Texteditor and save as TestPart.txt 
>>> 
>>> Then use the following code
>>> 
>>> library(methods)
>>> setClass("of")
>>> setAs("character", "of", function(from) as.ordered(from)) 
>>> 
>>> Classe81<-cclasses <- c(rep("factor", 64),  rep("numeric",6), rep ("of",
>>> 12))
>>> 
>>> TestPart<-read.table("TestPart.txt", header=TRUE,row.names=1,
>>> na.strings="NA" ,colClasses = Classe81)
>>> 
>>> str(TestPart)
>>> 
>>> library(polycor)
>>> 
>>> TestPart.hetcor<-hetcor(TestPart, use="complete.obs")
>>> 
>>> this will produce the above mentioned error message that I can not
>>> interprete.
>>> 
>>> Would be great if somebody could help me to solve the problem.
>>> 
>>> Thanks
>>> 
>>> B.
>>> 
>>> 
>>> 
>>> 
>>> 1   2   3   4   7   8   9   10  12  
>>> 13  14  15  16  17  18  19  21  22  23  
>>> 25  27  28  29  30  31  33
>>> 34  35  36  37  38  39  40  41  42  43  
>>> 44  45  46  47  48  49  50  51  52  53  
>>> 54  55  56  58
>>> 59  60  61  62  63  64  65  66  67  68  
>>> 69  

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle

Many Thanks Mark for your answer.

It seems than, that it is not possible to use all variables without somehow
imputing missing values.

But I will try which variables I can finally use.

Many thanks again.

B.


Mark Difford wrote:
> 
> Hi Birgitle,
> 
> It seems to be failing on those columns that have just a single "entry"
> (i.e = 1, with the rest as 0; having just 1, an , and then 0s gets you
> through). And there are other reasons for failure (in the call to get a
> positive definite matrix).
> 
> The main problem lies in the calculation of standard errors for some
> combinations. You can get a result for all columns by turning this off.
> You can get standard errors for all the columns up to 60 by omitting
> columns 12, 23, and 44.  You need to work out the rest yourself by
> "columning" forwards till you get a failure, then drop that column from
> the index. There probably isn't enough information to calculate SEs for
> the columns that cause an error.
> 
> ## This works with default settings but without columns 12, 23 and 44
> hetcor(TestPart[,c(1:11,13:22,24:43,45)], pd=T, std.err=T,
> use="complete.obs")
> 
> ## The first fails; the second works
> hetcor(TestPart[,c(1:11,13:22,24:43,45:60)], pd=T, std.err=F)
> hetcor(TestPart[,c(1:72)], pd=F, std.err=F)
> 
> HTH, Mark.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Problems-using-hetcor-%28polycor%29-tp18867343p18870543.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] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle

Thanks for all your help and the time you spent. It is now my turn to find my
way. Maybe it is enough to have the Correlations.

Final remark:

Both of your examples work and in the first case are only a few standard
errors missing. Unfortunately its not my whole dataset


Mark Difford wrote:
> 
> ## The first fails; the second works 
> hetcor(TestPart[,c(1:11,13:22,24:43,45:60)], pd=T, std.err=F) 
> hetcor(TestPart[,c(1:72)], pd=F, std.err=F) 
> 
> 


Mark Difford wrote:
> 
> Hi Birgitle,
> 
>>> It seems than, that it is not possible to use all variables without
>>> somehow 
>>> imputing missing values.
> 
> It depends on what you are after. You can use the full data set if you set
> std.err=F and pd=F. Then exclude the columns that cause it to falter and
> redo with SEs turned on. You have the correlations; all you lack are SEs
> for ca. 5 columns.
> 
> And I haven't tried your revised classification; that's for you to do.
> 
> Regards, Mark.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Problems-using-hetcor-%28polycor%29-tp18867343p18871415.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] Switch two rows in a matrix

2008-08-07 Thread Birgitle

sorry here the right thing

a<-a[c(1,3,2,4),c(1,3,2,4)]

B.


Birgitle wrote:
> 
> You could perhaps do it like that
> 
> a<-a[c(1,2,4,3),]
> 
> B.
> 
> 
> Zhang Yanwei - Princeton-MRAm wrote:
>> 
>> Hi all,
>>   I have a 4 by 4 matrix, and I want to switch row 2 and row 3 first,
>> then switch column 2 and column 3. Is there an easy way to do it?
>> The following is a tedious way to get what I want. But I wonder if there
>> is a way to simplify this.
>> 
>>  > a=matrix(rnorm(16),4,4)
>>> a
>> [,1]   [,2][,3]   [,4]
>> [1,]  0.33833811 -0.9422273 -0.06181611 -1.8346134
>> [2,] -0.68167996  0.2004836  0.71079887 -1.1590184
>> [3,]  0.07811688  0.1338694 -1.61262688  0.2988365
>> [4,]  0.21869786 -1.6356661 -0.13694344 -1.2121355
>>> b=a
>>> b[2,]=a[3,]
>>> b[3,]=a[2,]
>>> b
>> [,1]   [,2][,3]   [,4]
>> [1,]  0.33833811 -0.9422273 -0.06181611 -1.8346134
>> [2,]  0.07811688  0.1338694 -1.61262688  0.2988365
>> [3,] -0.68167996  0.2004836  0.71079887 -1.1590184
>> [4,]  0.21869786 -1.6356661 -0.13694344 -1.2121355
>>> c=b
>>> c[,2]=b[,3]
>>> c[,3]=b[,2]
>>> c
>> [,1][,2]   [,3]   [,4]
>> [1,]  0.33833811 -0.06181611 -0.9422273 -1.8346134
>> [2,]  0.07811688 -1.61262688  0.1338694  0.2988365
>> [3,] -0.68167996  0.71079887  0.2004836 -1.1590184
>> [4,]  0.21869786 -0.13694344 -1.6356661 -1.2121355
>> 
>> 
>> Sincerely,
>> Yanwei Zhang
>> Department of Actuarial Research and Modeling
>> Munich Re America
>> Tel: 609-275-2176
>> Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
>> 
>> 
>>  [[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.
>> 
>> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Switch-two-rows-in-a-matrix-tp18872329p18872854.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] Switch two rows in a matrix

2008-08-07 Thread Birgitle

You could perhaps do it like that

a<-a[c(1,2,4,3),]

B.


Zhang Yanwei - Princeton-MRAm wrote:
> 
> Hi all,
>   I have a 4 by 4 matrix, and I want to switch row 2 and row 3 first, then
> switch column 2 and column 3. Is there an easy way to do it?
> The following is a tedious way to get what I want. But I wonder if there
> is a way to simplify this.
> 
>  > a=matrix(rnorm(16),4,4)
>> a
> [,1]   [,2][,3]   [,4]
> [1,]  0.33833811 -0.9422273 -0.06181611 -1.8346134
> [2,] -0.68167996  0.2004836  0.71079887 -1.1590184
> [3,]  0.07811688  0.1338694 -1.61262688  0.2988365
> [4,]  0.21869786 -1.6356661 -0.13694344 -1.2121355
>> b=a
>> b[2,]=a[3,]
>> b[3,]=a[2,]
>> b
> [,1]   [,2][,3]   [,4]
> [1,]  0.33833811 -0.9422273 -0.06181611 -1.8346134
> [2,]  0.07811688  0.1338694 -1.61262688  0.2988365
> [3,] -0.68167996  0.2004836  0.71079887 -1.1590184
> [4,]  0.21869786 -1.6356661 -0.13694344 -1.2121355
>> c=b
>> c[,2]=b[,3]
>> c[,3]=b[,2]
>> c
> [,1][,2]   [,3]   [,4]
> [1,]  0.33833811 -0.06181611 -0.9422273 -1.8346134
> [2,]  0.07811688 -1.61262688  0.1338694  0.2988365
> [3,] -0.68167996  0.71079887  0.2004836 -1.1590184
> [4,]  0.21869786 -0.13694344 -1.6356661 -1.2121355
> 
> 
> Sincerely,
> Yanwei Zhang
> Department of Actuarial Research and Modeling
> Munich Re America
> Tel: 609-275-2176
> Email: [EMAIL PROTECTED]
> 
> 
>   [[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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Switch-two-rows-in-a-matrix-tp18872329p18872790.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.


[R] mob(party) formula question

2008-08-13 Thread Birgitle

I try tu use mob() with my data.frame ('data.frame':288 obs. of  81
variables; factors, numerics and ordered factors)
My response is a binary variable and I should use for modelling a logistic
regression (family=binomial).

I read in the "MOB" Vignette that I could use a formula like this if I would
like to have only partitioning variables apart from the response.

Test.mob<-mob(Resp~1|Var1+Var2+, data=dataframe, model=glinearModel,
family=binomial())

but this gives me back an error-message:

Fehler in `[.data.frame`(x, r, vars, drop = drop) : 
  undefined columns selected

Error in `[.data.frame`(x, r, vars, drop = drop) : 
  undefined columns selected

But Var1, Var2 and Resp are in my dataframe. Why do I get this error?

I am also wondering how I can find out which variables I should use for
partitioning and which for modelling?

There are correlations between some variables in my dataframe. Would it be a
possibility to use always one variable of the correlated variable-pairs for
partitioning and one for modelling?

I would be very happy if somebody could give me some hints or answers to my
questions.

Many thanks in advance.

B.



-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/mob%28party%29-formula-question-tp18959898p18959898.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] mob(party) formula question (example)

2008-08-13 Thread Birgitle
   0   0   1   0   0   0   0
0   0   0   1   0   0   0   0   0   1   
1   0   0   0   0   1   0   55  20  5.5 
30  4.5 2.5 5   5   2   2   3   3   1   
1   1   1   4
5
TY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   0   1   0   0   1   
0   1   1   0   0   0   0   1   0   0   
1   0   0   1   1   0   0   0
0   0   0   1   0   0   0   0   0   1   
0   0   0   0   1   0   0   40  15  4.5 
25  2.751.755   5   2   2   3   3   1   
1   1   1
4   6
UY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   1   1   0   0   1   
1   0   0   0   0   0   1   1   0   0   
1   0   0   1   0   1   0   0
1   0   1   1   0   0   0   0   0   1   
1   0   0   0   0   1   0   200 27.56.5 
25  2.452.255   5   2   2   2   3   1   
1
1   2   7   7
VY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   1   1   0   0   1   
1   0   1   0   0   1   0   1   0   0   
1   0   0   1   1   1   0   0
0   0   0   1   0   0   0   0   0   0   
1   1   0   0   0   1   0   135 17.55.5 
17.52.752.255   5   2   2   2   3   1
1   1   2   5   7
WY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   0   1   0   0   1   
1   0   0   0   0   1   0   1   0   0   
1   1   0   1   0   1   1   0
0   0   0   1   0   0   0   0   0   0   
1   0   0   0   1   0   1   240 35  5.5 
14  3.252.755   5   2   2   2   3   1   
1   1
2   7   7
XY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   1   1   0   0   1   
1   0   0   0   0   0   1   0   0   0   
1   0   0   1   0   0   0   0
0   0   1   1   0   0   0   0   0   0   
1   0   0   0   1   0   0   175 27.54   
10.52.5 1.875   5   5   2   2   2   2   1   
1
1   1   6   7
YY  0   0   1   0   0   1   0   1   0   
1   0   0   0   0   1   1   0   0   1   
1   0   1   0   0   1   1   1   0   0   
0   0   0   0   0   1   0   0
0   0   0   1   0   0   0   0   0   1   
1   0   0   0   0   0   1   230 42.55.6 
25  2.5 2.5 5   5   2   2   2   2   1   
1   1
2   5   7
ZY  0   1   0   0   0   1   0   1   0   
1   0   0   0   0   1   0   0   1   0   
0   0   1   0   0   0   0   0   0   0   
0   1   0   0   0   0   1   1
0   0   0   0   0   0   0   0   0   0   
0   1   0   0   0   0   1   115 35  10.5
20  7.5 6.5 5   5   1   1   3   3   1   
1   1   3
4   5

using this:

library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from))

Classe72<-cclasses <- c(rep("factor", 55),  rep("numeric",6), rep ("of",
12))

DFExample<-read.table("DFExample.txt", header=TRUE,row.names=1,
na.strings="NA" ,colClasses = Classe72) 

then "party with the mob":

library(party)

Test.mob<-mob(X1~1|X34+X45+X73, data=DFExample, model=glinearModel,
family=binomial())

Fehler in `[.data.frame`(x, r, vars, drop = drop) : 
  undefined columns selected

B.





Birgitle wrote:
> 
> I try tu use mob() with my 

Re: [R] mob(party) formula question

2008-08-13 Thread Birgitle

Many thanks for your answer and the code that you offered me.

I get this error message after calling mob (look at my given example).
I guess it has something to do with the missings?

The iris example works also fine for me.

Sorry that I am not enough into statistics to really understand the
following:


Achim Zeileis wrote:
> 
> 
> .
> For the variables for which a linear specification makes sense (at least
> in each component) then you should include them for modeling. And those
> variables for which it is not clear a priori what a useful parametric
> specification would be should be used as partitioning variables. 
> ...
> 
> 

What do you mean with "linear specification"? I would be very happy if you
could explain.

Thanks again

B.



Achim Zeileis wrote:
> 
> On Wed, 13 Aug 2008, Birgitle wrote:
> 
>> I try tu use mob() with my data.frame ('data.frame': 288 obs. of  81
>> variables; factors, numerics and ordered factors)
>> My response is a binary variable and I should use for modelling a
>> logistic
>> regression (family=binomial).
>>
>> I read in the "MOB" Vignette that I could use a formula like this if I
>> would
>> like to have only partitioning variables apart from the response.
>>
>> Test.mob<-mob(Resp~1|Var1+Var2+, data=dataframe, model=glinearModel,
>> family=binomial())
> 
> This works for me. Considering an example that is easily reproducible: 
> classifying just two (out of three) species in the iris data.
> 
> iris2 <- iris[-(1:50),]
> iris2$Species <- factor(iris2$Species)
> mb <- mob(Species ~ 1 | Petal.Length + Petal.Width + Sepal.Length +
> Sepal.Width, data = iris2, model = glinearModel, family = binomial())
> 
> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/mob%28party%29-formula-question-tp18959898p18962866.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.


[R] Tiny help for tiny function

2008-08-13 Thread Birgitle

I just started to write tiny functions and therefore I appologise in advance
if I am asking stupid question.

I wrote a tiny function to give me back from the original matrix, a matrix
showing only the values smaller -0.8 and bigger 0.8.

y<-c(0.1,0.2,0.3,-0.8,-0.4,0.9) 
x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3)

 XY<-rbind(x,y)

extract.values<-function (x)
{
if(x>=0.8|x<=-0.8)x
else("low corr.")

}

works:

Test<-sapply(XY,extract.values,simplify=FALSE)

but now I try to solve the problem of having NA in the matrix.
I tried like that:

extract.values<-function (x)
{
if(x>=0.8|x<=-0.8|x==NA)x
else("low corr.")

}

woks not:

x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3)
y<-c(0.1,0.2,NA,-0.8,-0.4,0.9)

XY<-rbind(x,y)

Testi<-sapply(XY,extract.values,simplify=FALSE)

Fehler in if (x >= 0.8 | x <= -0.8 | x == NA) x else ("low corr.") : 
  Fehlender Wert, wo TRUE/FALSE nötig ist

Error in if (x >= 0.8 | x <= -0.8 | x == NA) x else ("low corr.") : 
  Missing value, where TRUE/FALSE is needed

How can I do this right.

Thanks for help

B.

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Tiny-help-for-tiny-function-tp18963310p18963310.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] Tiny help for tiny function

2008-08-13 Thread Birgitle

Many thanks.

Much easier than my solution

B.


Birgitle wrote:
> 
> I just started to write tiny functions and therefore I appologise in
> advance if I am asking stupid question.
> 
> I wrote a tiny function to give me back from the original matrix, a matrix
> showing only the values smaller -0.8 and bigger 0.8.
> 
> y<-c(0.1,0.2,0.3,-0.8,-0.4,0.9)   
> x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3)
> 
>  XY<-rbind(x,y)
> 
> extract.values<-function (x)
> {
> if(x>=0.8|x<=-0.8)x
> else("low corr.")
>   
>   }
> 
> works:
> 
> Test<-sapply(XY,extract.values,simplify=FALSE)
> 
> but now I try to solve the problem of having NA in the matrix.
> I tried like that:
> 
> extract.values<-function (x)
> {
> if(x>=0.8|x<=-0.8|x==NA)x
> else("low corr.")
>   
>   }
> 
> woks not:
> 
> x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3)
> y<-c(0.1,0.2,NA,-0.8,-0.4,0.9)
> 
> XY<-rbind(x,y)
> 
> Testi<-sapply(XY,extract.values,simplify=FALSE)
> 
> Fehler in if (x >= 0.8 | x <= -0.8 | x == NA) x else ("low corr.") : 
>   Fehlender Wert, wo TRUE/FALSE nötig ist
> 
> Error in if (x >= 0.8 | x <= -0.8 | x == NA) x else ("low corr.") : 
>   Missing value, where TRUE/FALSE is needed
> 
> How can I do this right.
> 
> Thanks for help
> 
> B.
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Tiny-help-for-tiny-function-tp18963310p18963906.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] mob(party) formula question

2008-08-13 Thread Birgitle

Thanks again.
Unfortunately I have always this missing values problem.
But the missings have also a meaning and its impossible to code it
differently or impute.

Also thanks for the explanation. Now I understand.

B.


Achim Zeileis wrote:
> 
> On Wed, 13 Aug 2008, Birgitle wrote:
> 
>> Many thanks for your answer and the code that you offered me.
>>
>> I get this error message after calling mob (look at my given example).
>> I guess it has something to do with the missings?
> 
> Yes, you have to handle NAs in advance if you want to fit that model. 
> We'll try to fix that in future versions.
> 
>> The iris example works also fine for me.
>>
>> Sorry that I am not enough into statistics to really understand the
>> following:
>>
>>
>> Achim Zeileis wrote:
>>>
>>>
>>> .
>>> For the variables for which a linear specification makes sense (at least
>>> in each component) then you should include them for modeling. And those
>>> variables for which it is not clear a priori what a useful parametric
>>> specification would be should be used as partitioning variables.
>>> ...
>>>
>>>
>>
>> What do you mean with "linear specification"? I would be very happy if
>> you
>> could explain.
> 
> Well, in each node you fit a logistic regression model. This is a 
> (generalized) linear model, hence the variables included have a linear 
> influence (on the link scale) within each node. The partitioning variables 
> on the other hand capture step-shaped influences (if they are selected by 
> the algorithm). See the references on ?mob for further details.
> 
> Best,
> Z
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/mob%28party%29-formula-question-tp18959898p18964864.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.


[R] No object with name: PDE

2008-08-19 Thread Birgitle

Hello R-User!

When I plot my rpart-object:

 plot(data.rpart); text(data.rpart,cex=0.2, use.n=T)

I get this error message

No object with name:  PDE

Can somebody tell me why and what the meaning of the message is?

Many thanks in advance

B.



-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/No-object-with-name%3A--PDE-tp19046286p19046286.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.


[R] cluster a distance(analogue)-object using agnes(cluster)

2008-09-02 Thread Birgitle

I try to perform a clustering using an existing dissimilarity matrix that I
calculated using distance (analogue)
I tried two different things. One of them worked and one not and I don`t
understand why.
Here the code:

not working example

library(cluster)
library(analogue)

iris2<-as.data.frame(iris)
str(iris2)
'data.frame':   150 obs. of  5 variables:
 $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
 $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
 $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
 $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
 $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1
1 1 1 ...

Test.Gower <- distance(iris2, method ="mixed")
Test.Gower.agnes<-agnes(Test.Gower, diss=T)
Fehler in agnes(Test.Gower, diss = T) : 
  (list) Objekt kann nicht nach 'logical' umgewandelt werden
Error in agnes(Test.Gower, diss=T).
(list) object can`t be transformed to "logical"

working example only numerics used:

library(cluster)
library(analogue)

irisPart<-subset(iris, select= Sepal.Length:Petal.Width)
Dist.Gower <- distance(irisPart, method ="mixed")
AgnesA <- agnes(Dist.Gower, method="average", diss=TRUE) 

Would be great if somebody could help me.
The dataset that I would like to use for the clustering also contains
factors.
and gives me the same Error message as in the not working example.

Thanks in advance

B.






-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/cluster-a-distance%28analogue%29-object-using-agnes%28cluster%29-tp19267349p19267349.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] cluster a distance(analogue)-object using agnes(cluster)

2008-09-03 Thread Birgitle

Hello R-User!

I still would be happy about an answer.
Further explanation:

I use distance(analogue), because I can give there a different weighting to
my used variables.
I would be interested, if there is the information in my Dissimilarity
matrix, that I used also factors and if this prevents agnes(cluster) to
perform a clustering?



Thanks again

B.

Birgitle wrote:
> 
> I try to perform a clustering using an existing dissimilarity matrix that
> I calculated using distance (analogue)
> I tried two different things. One of them worked and one not and I don`t
> understand why.
> Here the code:
> 
> not working example
> 
> library(cluster)
> library(analogue)
> 
> iris2<-as.data.frame(iris)
> str(iris2)
> 'data.frame': 150 obs. of  5 variables:
>  $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
>  $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
>  $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
>  $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
>  $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1
> 1 1 1 1 ...
> 
> Test.Gower <- distance(iris2, method ="mixed")
> Test.Gower.agnes<-agnes(Test.Gower, diss=T)
> Fehler in agnes(Test.Gower, diss = T) : 
>   (list) Objekt kann nicht nach 'logical' umgewandelt werden
> Error in agnes(Test.Gower, diss=T).
> (list) object can`t be transformed to "logical"
> 
> working example only numerics used:
> 
> library(cluster)
> library(analogue)
> 
> irisPart<-subset(iris, select= Sepal.Length:Petal.Width)
> Dist.Gower <- distance(irisPart, method ="mixed")
> AgnesA <- agnes(Dist.Gower, method="average", diss=TRUE) 
> 
> Would be great if somebody could help me.
> The dataset that I would like to use for the clustering also contains
> factors.
> and gives me the same Error message as in the not working example.
> 
> Thanks in advance
> 
> B.
> 
> 
> 
> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/cluster-a-distance%28analogue%29-object-using-agnes%28cluster%29-tp19267349p19288302.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] Swap variables in data.frame

2008-06-02 Thread Birgitle

Thanks Paul.

I am not sure if I understood well, but when I do it then I have only two
columns left:

> L3 <- LETTERS[1:3]
> (d <- data.frame(cbind(x=1, y=1:10, z=11:20), fac=sample(L3, 10,
> replace=TRUE)))
   x  y  z fac
1  1  1 11   C
2  1  2 12   B
3  1  3 13   B
4  1  4 14   C
5  1  5 15   C
6  1  6 16   B
7  1  7 17   C
8  1  8 18   C
9  1  9 19   B
10 1 10 20   C
> d <- d[,c(2,1)]
> d
y x
1   1 1
2   2 1
3   3 1
4   4 1
5   5 1
6   6 1
7   7 1
8   8 1
9   9 1
10 10 1

But I have more than two columns in my data.frame.

Birgit



Paul Smith wrote:
> 
> On Mon, Jun 2, 2008 at 11:59 AM, Blubbele <[EMAIL PROTECTED]>
> wrote:
>>
>> Thanks but it swaps in both cases only the data:
>>
>> FemMal_88[c(61,62)]=FemMal_88[c(62,61)]
>>
>>
>> FemMal_88[,c(61,62)]=FemMal_88[,c(62,61)]
> 
> The following works:
> 
> d <- data.frame(a=c(1,2),b=c(3,4))
> d <- d[,c(2,1)]
> 
> Paul
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Swap-variables-in-data.frame-tp17597476p17599719.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] Swap variables in data.frame

2008-06-02 Thread Birgitle

That works perfect.

Thanks a lot Paul!

Greets

Birgit


Paul Smith wrote:
> 
> On Mon, Jun 2, 2008 at 1:04 PM, Birgitle <[EMAIL PROTECTED]>
> wrote:
>>
>> Thanks Paul.
>>
>> I am not sure if I understood well, but when I do it then I have only two
>> columns left:
>>
>>> L3 <- LETTERS[1:3]
>>> (d <- data.frame(cbind(x=1, y=1:10, z=11:20), fac=sample(L3, 10,
>>> replace=TRUE)))
>>   x  y  z fac
>> 1  1  1 11   C
>> 2  1  2 12   B
>> 3  1  3 13   B
>> 4  1  4 14   C
>> 5  1  5 15   C
>> 6  1  6 16   B
>> 7  1  7 17   C
>> 8  1  8 18   C
>> 9  1  9 19   B
>> 10 1 10 20   C
>>> d <- d[,c(2,1)]
>>> d
>>y x
>> 1   1 1
>> 2   2 1
>> 3   3 1
>> 4   4 1
>> 5   5 1
>> 6   6 1
>> 7   7 1
>> 8   8 1
>> 9   9 1
>> 10 10 1
>>
>> But I have more than two columns in my data.frame.
> 
> In your case, it should be
> 
> # Swap the two first columns
> d <- d[,c(2,1,3,4)]
> # Swap column 2 and 3
> d <- d[,c(1,3,2,4)]
> 
> Notice that my data frame had only two columns.
> 
> Paul
> 
> __
> 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.
> 
> 
Bb205Lc

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Swap-variables-in-data.frame-tp17597476p17600374.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] Swap variables in data.frame

2008-06-03 Thread Birgitle

Thanks might be easier in my case because I have so many variables.
Could have found this solution on my own.

Birgit


Rogers, James A [PGRD Groton] wrote:
> 
> 
> Birgit Lemcke wrote:
> 
>> I have a dataframe and two of my variables are in the wrong position 
>> and I would like to swap those variables. 
> 
> In addition to the other solutions posted, if you prefer to reference
> the columns by name rather than by index, you could use subset() 
> 
> dat <- data.frame(a = letters[1:3], b = LETTERS[1:3], c = 1:3, d = 3:1)
> 
> subset(dat, select = c(b, a, c, d))
> ## or equivalently, something like:
> subset(dat, select = c(b:a, c:d))
> 
> 
> --Jim 
> 
> James A. Rogers, Ph.D. 
> Associate Director, Neuroscience Statistics
> Pfizer Global R&D New London
> 50 Pequot Avenue (MS 6025-B2131)
> New London, CT 06320
> office: (860) 732-0783
> cell: (860) 501-7228
> fax: (860) 686-7866
> 
>  
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Swap-variables-in-data.frame-tp17597476p17626237.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.


[R] missing data imputation - simulation

2008-06-04 Thread Birgitle

My dataset contains missing data and I would like to do something like an EM
algorithm or a Markov Chain Monte Carlo approach to get rid of the missing
data.

Is there a function for imputation or simulation of missing data apart from
those in the randomForest library?

Thanks in advance

Birgit

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/missing-data-imputation---simulation-tp17642736p17642736.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] missing data imputation - simulation

2008-06-04 Thread Birgitle

Many thenks to both of you:
Will have a look.

Birgit


Chuck Cleland wrote:
> 
> On 6/4/2008 5:32 AM, Birgitle wrote:
>> My dataset contains missing data and I would like to do something like an
>> EM
>> algorithm or a Markov Chain Monte Carlo approach to get rid of the
>> missing
>> data.
>> 
>> Is there a function for imputation or simulation of missing data apart
>> from
>> those in the randomForest library?
>> 
>> Thanks in advance
>> 
>> Birgit
> 
> RSiteSearch("imputation", restrict="functions")
> 
> RSiteSearch("{multiple imputation}", restrict="functions")
> 
>return many relevant hits.
> 
>> -
>> The art of living is more like wrestling than dancing.
>> (Marcus Aurelius)
> 
> -- 
> Chuck Cleland, Ph.D.
> NDRI, Inc. (www.ndri.org)
> 71 West 23rd Street, 8th floor
> New York, NY 10010
> tel: (212) 845-4495 (Tu, Th)
> tel: (732) 512-0171 (M, W, F)
> fax: (917) 438-0894
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/missing-data-imputation---simulation-tp17642736p17644180.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] bartlett.test()

2008-06-05 Thread Birgitle

I think you should specify your grouping factor:

g   a vector or factor object giving the group for the corresponding
elements of x. Ignored if x is a list.

batlett.test(xx, groupingfactor)

Hope this helps.

Birgit


hanen wrote:
> 
> i'm trying to test the homogeneity of variance of 92 samples each one
> contains 3 observations.
> to use bartlett.test function i have created a (3,92) matrix (named xx):
>>bartlett.test(xx)
> 
> this message appears:
> 
>>Erreur dans bartlett.test.default(xx) : 
>   l'argument "g" est manquant, avec aucune valeur par défaut
> 
> when i checked the help i have understood that in g i should specified my
> différent samples in the case that xx is not a list.So i have tried to
> convert mode's xx in the list by:
> 
>>bartlett.test(list(xx))
> 
> this message appears:
> 
>>Erreur dans bartlett.test.default(list(xx)) : 
>   'x' must be a list with at least 2 elements
> 
> what should i do?
> and if the solution is to use a data frame how can i add the 92
> columns'names to such data.frame? because the use of the function
> names(data.frame)<-list("...  and entering 92 words it seems painfull.
> 
>  is there any one who can help me now?
> 
> please answer me as soon as possible. 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/bartlett.test%28%29-tp17665173p17665913.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.


[R] Delete NA from a dist object

2008-06-05 Thread Birgitle

I have a dist object containing 1 row that is only NA (not very intelligent
to have bas dataset with one NA speciesanyway).
I would like to delete this row from this object.

It may be not a difficult problem but I can not find a solution presently.

So I would be very happy if somebody could give ma a hint

Thanks

B.

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Delete-NA-from-a-dist-object-tp17670016p17670016.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] Delete NA from a dist object

2008-06-05 Thread Birgitle

Many thanks.

Is there a way to give me the number of the row, if I have the row name?

B.


mel-10 wrote:
> 
> Birgitle a écrit :
> 
>> I have a dist object containing 1 row that is only NA (not very
>> intelligent
>> to have bas dataset with one NA speciesanyway).
>> I would like to delete this row from this object.
> 
> newDistObject = distObject[-unwantedRow, ]
> 
> hih
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Delete-NA-from-a-dist-object-tp17670016p17670598.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] Delete NA from a dist object

2008-06-05 Thread Birgitle

Additonally I got this error message

TestDist = Dist.HalbDisGow88[-147,]

Fehler in Dist.HalbDisGow88[-147, ] : falsche Anzahl von Dimensionen
(Error in Dist.HalbDisGow88[-147, ] : wrong number of dimensions

Birgit



mel-10 wrote:
> 
> Birgitle a écrit :
> 
>> I have a dist object containing 1 row that is only NA (not very
>> intelligent
>> to have bas dataset with one NA speciesanyway).
>> I would like to delete this row from this object.
> 
> newDistObject = distObject[-unwantedRow, ]
> 
> hih
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Delete-NA-from-a-dist-object-tp17670016p17670720.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] Delete NA from a dist object

2008-06-05 Thread Birgitle

Have still some problems

match("name", names(object))
[1] NA

which(names(object)=="Iname")
integer(0)


TestDist = object[-"name",]
Fehler in -"name" : ungültiges Argument für unären Operator
Error in -"name": invalid argument for unären (don`t know what this means)
operator

Thanks

Birgit



mel-10 wrote:
> 
> Birgitle a écrit :
>> Many thanks.
>> Is there a way to give me the number of the row, if I have the row name?
>> B.
> 
> a= object
> 'w' = name
> 
>  > match('w', names(a))
> 
> # or
> 
>  > which(names(a)=='w')
> 
> # or
> 
> but deletion should work with the number and/or with the name.
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Delete-NA-from-a-dist-object-tp17670016p17671297.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] How to change the class of data?

2008-06-12 Thread Birgitle

I have an additional question concerning to this topic.

I usually use something liek that:

read.table(,  colClasses=c("numeric", "factor", "character",
"my.funny.class"))

but why can I not implement "ordered.factor" in there?

Birgit


Kenn Konstabel wrote:
> 
> Conversion to factor may happen (and often does) when you read in data
> with
> read.table(). So one solution may be reading in the same data again in a
> slightly different way:
> 
> read.table(file="mydatafile", as.is=TRUE)
> # see also ?read.table
> 
> You can also specify a class to each column of the data you're about to
> read
> in:
> read.table(,  colClasses=c("numeric", "factor", "character",
> "my.funny.class"))
> 
> 
> Ad take a look at   http://cran.r-project.org/doc/FAQ/R-FAQ.htmlp.
> 7.10
> for the right answer -- in any case, don't use as.numeric(x)!
> 
> Kenn
> 
> 
> On Thu, Jun 12, 2008 at 9:24 AM, Qman Fin <[EMAIL PROTECTED]> wrote:
> 
>> Hi all,
>>
>> I have some data x, which are actualy consisted of numerical enties. But
>> the
>> class of this matrix is set to be "factor" by someone else. I used
>> "class(x)", it turns out to be "factor". So I can not calculate them.
>>
>> How can I turn them into numerical data so that I can apply math
>> operations
>> on them? Thanks a lot for your help.
>>
>> Selina
>>
>>[[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.
>>
> 
>   [[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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/How-to-change-the-class-of-data--tp17793351p17795106.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.


[R] randomForest outlier

2008-06-18 Thread Birgitle

I try to use ?randomForest to find variables that are the most important to
divide my dataset (continuous, categorical variables) in two given groups.

But when I plot the outliers:

plot(outlier(FemMalSex_NAavoid88.rf33, cls=FemMalSex_NAavoid88$Sex),
type="h",col=c("red","green")[as.numeric(FemMalSex_NAavoid88$Sex)])

it seems to me that all my values appear as outliers.
Has anybody suggestions what is going wrong in my analysis?




-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/randomForest-outlier-tp17979182p17979182.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] Cluster on both categorical and numerical data

2008-06-18 Thread Birgitle

You could have a look at library(analogue) , function ?distance

and library (cluster), function ?agnes

B.


Chua Siang Li wrote:
> 
> 
>Hello there.  Is there any function in R that can do cluster on a set
> of
>data that has both categorical and numerical variables?  thanks.
>siangli
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Cluster-on-both-categorical-and-numerical-data-tp17979370p17980106.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.


[R] ctree (party) plot meaning question

2008-06-30 Thread Birgitle

I tried to use ctree but am not sure about the meaning of the plot.

My.data.cf<-ctree(Resp~., data=My.data)
plot(FemMalSex_NAavoid88.ct)

My data.frame contains 88 explanatory variables (continous,ordered/unordered
multistate,count data) and one response with two groups.

In the plot are only two variables shown (2 internal nodes) and 3 final
nodes. Does it mean that only these two variables show a significant
asssociation with the response?

:confused:

Many thanx in advance

B.





-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/ctree-%28party%29-plot-meaning-question-tp18200611p18200611.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.


[R] problems using mice()

2008-07-09 Thread Birgitle

R 2.7.2
PPC Mac OS X 10.4.11
library mice 1.13.1

I try to use mice for multivariate data imputation.
My variables are numeric, factors, count data, ordered factors.

First I created a vector for the methods to use with each variable

  ImpMethMice<-c(rep("logreg", 62), rep("polyreg",1), rep("norm",12),
rep("polyreg",12))

next step was

 Test<-mice(df, im=ImpMethMice)

I got the following error message:

iter imp variable
  1   1  variablenameFehler in impute.logreg(c(2L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 1L, 2L,  : 
  Dimensionen [Produkt 119] passen nicht zur Länge des Objektes [122]
Zusätzlich: Es gab 50 oder mehr Warnungen (Anzeige der ersten 50 mit
warnings())

 1   1  variablenameError in impute.logreg(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L,
2L, 2L, 1L, 2L,  : 
  dimensions [product 119] don`t match lenght of object [122]
Additional: 50 or more warnings (show first 50 with warnings())

warnings()

1: In any(predictorMatrix[j, ]) ... : wandle Argument des Typs 'double' nach
boolesch

1: In any(predictorMatrix[j, ]) ... : transform argument of type 'double' to
boolesch

I would be very happy if somebody could help me to fix this.
Thanks in advance.

B.

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/problems-using-mice%28%29-tp18358093p18358093.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.


[R] ace error because of missings?

2008-07-10 Thread Birgitle

Hello RUser!

I try to use ace for an ancestral state reconstruction but got back an error
message.

 ace(FacVar,Tree, type="discrete")

Warning messages:
1: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt (NA/Inf replaced by positive
number)
2: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
3: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
4: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
5: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
6: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
7: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
8: In nlm(function(p) dev(p), p = rep(ip, length.out = np), hessian = TRUE)
:
  NA/Inf durch größte positive Zahl ersetzt
9: In ace(SummaCharNAavoidOpt7$Spik_orient_Anth_Diff,
RestioTreeOoutgrBLrooted,  :
  The likelihood gradient seems flat in at least one dimension (gradient
null):
cannot compute the standard-errors of the transition rates.

I presume it is due to my missing values?

 na.pattern(dataframe)
#dataframe contains 7 discrete characters. I get an error message with
all of them

pattern
000 001 100 001 010 100 1001000 1100100 111 
274   51   372  
 
114 

Can I fix this somehow?

Thanks in advance

Birgit



-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/ace-error-because-of-missings--tp18385322p18385322.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] randomForest outlier

2008-07-15 Thread Birgitle

Still the same question:


Birgitle wrote:
> 
> I try to use ?randomForest to find variables that are the most important
> to divide my dataset (continuous, categorical variables) in two given
> groups.
> 
> But when I plot the outlier:
> 
> plot(outlier(rfObject, cls=groupingVariable),
> type="p",col=c("red","green")[as.numeric(groupingVariable)])
> 
> it seems to me that all my values appear as outliers.
> Has anybody suggestions what is going wrong in my analysis?
> 
> 
> 
> 

Additonal remark
The scaling of the y-axis is quite small between -1 and 2. 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/randomForest-outlier-tp17979182p18466832.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.


[R] rpart with only two small groups

2008-09-16 Thread Birgitle

Hello R-User!

I try to do the following:

New<-iris[c(1:7,90:97),1:5]
New.rpart<-rpart(Species~., data=New, method="class")

New.rpart
n= 15 

node), split, n, loss, yval, (yprob)
  * denotes terminal node

1) root 15 7 versicolor (0.467 0.533) *

Does it mean it is not possible to find a variable that splits my groups or
are my groups just to small?
Is there a way to find out the variable that splits my groups best?

Thanks in advance for help.

B.

-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/rpart-with-only-two-small-groups-tp19516515p19516515.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] rpart with only two small groups

2008-09-17 Thread Birgitle

Thanks Gavin and sorry to all for this unnecessary question.

B.


Gavin Simpson wrote:
> 
> On Tue, 2008-09-16 at 10:47 -0700, Birgitle wrote:
>> Hello R-User!
>> 
>> I try to do the following:
>> 
>> New<-iris[c(1:7,90:97),1:5]
>> New.rpart<-rpart(Species~., data=New, method="class")
>> 
>> New.rpart
>> n= 15 
>> 
>> node), split, n, loss, yval, (yprob)
>>   * denotes terminal node
>> 
>> 1) root 15 7 versicolor (0.467 0.533) *
>> 
>> Does it mean it is not possible to find a variable that splits my groups
>> or
>> are my groups just to small?
>> Is there a way to find out the variable that splits my groups best?
> 
> Yes, as always, read the help file ;-)
> 
> ?rpart leads you to ?rpart.control, which has argument minsplit with
> default 20, which is the minimum number of observations in a node for a
> split to be attempted. As 15 is less than 20, the root node could not be
> split.
> 
> E.g.:
>> New<-iris[c(1:7,90:97),1:5]
>> New.rpart<-rpart(Species~., data=New, method="class", control =
> rpart.control(minsplit = 2))
>> New.rpart
> n= 15 
> 
> node), split, n, loss, yval, (yprob)
>   * denotes terminal node
> 
> 1) root 15 7 versicolor (0.467 0.533)  
>   2) Petal.Length< 2.5 7 0 setosa (1.000 0.000) *
>   3) Petal.Length>=2.5 8 0 versicolor (0.000 1.000) *
> 
> HTH
> 
> G
> 
>> 
>> Thanks in advance for help.
>> 
>> B.
>> 
>> -
>> The art of living is more like wrestling than dancing.
>> (Marcus Aurelius)
> -- 
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>  Dr. Gavin Simpson [t] +44 (0)20 7679 0522
>  ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
>  Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
>  Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
>  UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/rpart-with-only-two-small-groups-tp19516515p19526594.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.


[R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle

Hello R-Users!

I need a little help to build up a contingency table out of several
variables.

  A<-c("F","M","M","F","F","F","F","M","F","M","F","F")
  B<-c(0,0,0,0,0,0,1,1,1,1,0,1)
  C<-c(0,1,1,1,1,1,1,1,1,0,0,0)

  ABC<-as.data.frame(cbind(A,B,C))

  ABC

   A B C
1  F 0 0
2  M 0 1
3  M 0 1
4  F 0 1
5  F 0 1
6  F 0 1
7  F 1 1
8  M 1 1
9  F 1 1
10 M 1 0
11 F 0 0
12 F 1 0

I would like to count in each variable B and C the frequencies for M and F
(variable A) and finally get the following table:

 B   C
F   3   5

M  2   3

Is there a function that can do that in one step?
Tried ?structable, ?ftable, ?xtabs, ?table but could not get what I would
like to have.

Maybe I did not use the tried functions in the right way.

Many thanks in advance for any help.

B.



-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/contingency-table%2C-several-variables-from-dataframe-tp19775083p19775083.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] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle

Thanks for your answer.

It is intended, that the variables are treated as class factor, because
these are binary variables with, for example, the presence or the absence of
a plant organ.
As far as I understood, I have to treat them for other calculations as
factor. Therefore I classified these variables as factors in my original
dataframe.

If I do what you suggested, I have to change the classes of all my
variables. Is there a possibility to do something similar without changing
the classes?

B.


Eik Vettorazzi wrote:
> 
> First of all your construction of ABC leads to a structure with 3 factor 
> variables due to the way cbind processes the input variables -  which is 
> not intended I think.
> 
> You can do sth like
> 
> ABC<-data.frame(A,B,C)
> aggregate(ABC[,2:3],by=list(A),sum)
> 
> hth.
> 
> Birgitle schrieb:
>> Hello R-Users!
>>
>> I need a little help to build up a contingency table out of several
>> variables.
>>
>>   A<-c("F","M","M","F","F","F","F","M","F","M","F","F")
>>   B<-c(0,0,0,0,0,0,1,1,1,1,0,1)
>>   C<-c(0,1,1,1,1,1,1,1,1,0,0,0)
>>
>>   ABC<-as.data.frame(cbind(A,B,C))
>>
>>   ABC
>>
>>A B C
>> 1  F 0 0
>> 2  M 0 1
>> 3  M 0 1
>> 4  F 0 1
>> 5  F 0 1
>> 6  F 0 1
>> 7  F 1 1
>> 8  M 1 1
>> 9  F 1 1
>> 10 M 1 0
>> 11 F 0 0
>> 12 F 1 0
>>
>> I would like to count in each variable B and C the frequencies for M and
>> F
>> (variable A) and finally get the following table:
>>
>>  B   C
>> F   3   5
>>
>> M  2   3
>>
>> Is there a function that can do that in one step?
>> Tried ?structable, ?ftable, ?xtabs, ?table but could not get what I would
>> like to have.
>>
>> Maybe I did not use the tried functions in the right way.
>>
>> Many thanks in advance for any help.
>>
>> B.
>>
>>
>>
>> -
>> The art of living is more like wrestling than dancing.
>> (Marcus Aurelius)
>>   
> 
> -- 
> Eik Vettorazzi
> Institut für Medizinische Biometrie und Epidemiologie
> Universitätsklinikum Hamburg-Eppendorf
> 
> Martinistr. 52
> 20246 Hamburg
> 
> T ++49/40/42803-8243
> F ++49/40/42803-7790
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/contingency-table%2C-several-variables-from-dataframe-tp19775083p19777611.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] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle

I think it makes a difference if I want to use a classification method like
rpart () or if I use a modelling approach like glm().

Many thanks for the kind and fast help. I am still very untrained and it is
difficult for me to create such codes.

B.


Eik Vettorazzi wrote:
> 
> Ok, then treat them as factors - but if they are really binary and coded 
> 0 and 1, which kind of calculation would lead to different results for a 
> "factor" instead of a numeric variable?
> 
> Anyway,
> 
> ABC<-as.data.frame(cbind(A,B,C))
> aggregate(ABC[,2:3],by=list(A),FUN=function(x)sum(x=='1'))  # '1' is 
> here the level of the corresponding factor to be counted.
> 
> will work. A more sophisticated version could include some "factor to 
> numeric" conversion, see FAQ 7.10.
> hth.
> 
> Birgitle schrieb:
>> Thanks for your answer.
>>
>> It is intended, that the variables are treated as class factor, because
>> these are binary variables with, for example, the presence or the absence
>> of
>> a plant organ.
>> As far as I understood, I have to treat them for other calculations as
>> factor. Therefore I classified these variables as factors in my original
>> dataframe.
>>
>> If I do what you suggested, I have to change the classes of all my
>> variables. Is there a possibility to do something similar without
>> changing
>> the classes?
>>
>> B.
>>
>>
>> Eik Vettorazzi wrote:
>>   
>>> First of all your construction of ABC leads to a structure with 3 factor 
>>> variables due to the way cbind processes the input variables -  which is 
>>> not intended I think.
>>>
>>> You can do sth like
>>>
>>> ABC<-data.frame(A,B,C)
>>> aggregate(ABC[,2:3],by=list(A),sum)
>>>
>>> hth.
>>>
>>> Birgitle schrieb:
>>> 
>>>> Hello R-Users!
>>>>
>>>> I need a little help to build up a contingency table out of several
>>>> variables.
>>>>
>>>>   A<-c("F","M","M","F","F","F","F","M","F","M","F","F")
>>>>   B<-c(0,0,0,0,0,0,1,1,1,1,0,1)
>>>>   C<-c(0,1,1,1,1,1,1,1,1,0,0,0)
>>>>
>>>>   ABC<-as.data.frame(cbind(A,B,C))
>>>>
>>>>   ABC
>>>>
>>>>A B C
>>>> 1  F 0 0
>>>> 2  M 0 1
>>>> 3  M 0 1
>>>> 4  F 0 1
>>>> 5  F 0 1
>>>> 6  F 0 1
>>>> 7  F 1 1
>>>> 8  M 1 1
>>>> 9  F 1 1
>>>> 10 M 1 0
>>>> 11 F 0 0
>>>> 12 F 1 0
>>>>
>>>> I would like to count in each variable B and C the frequencies for M
>>>> and
>>>> F
>>>> (variable A) and finally get the following table:
>>>>
>>>>  B   C
>>>> F   3   5
>>>>
>>>> M  2   3
>>>>
>>>> Is there a function that can do that in one step?
>>>> Tried ?structable, ?ftable, ?xtabs, ?table but could not get what I
>>>> would
>>>> like to have.
>>>>
>>>> Maybe I did not use the tried functions in the right way.
>>>>
>>>> Many thanks in advance for any help.
>>>>
>>>> B.
>>>>
>>>>
>>>>
>>>> -
>>>> The art of living is more like wrestling than dancing.
>>>> (Marcus Aurelius)
>>>>   
>>>>   
>>> -- 
>>> Eik Vettorazzi
>>> Institut für Medizinische Biometrie und Epidemiologie
>>> Universitätsklinikum Hamburg-Eppendorf
>>>
>>> Martinistr. 52
>>> 20246 Hamburg
>>>
>>> T ++49/40/42803-8243
>>> F ++49/40/42803-7790
>>>
>>> __
>>> 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.
>>>
>>>
>>> 
>>
>>
>> -
>> The art of living is more like wrestling than dancing.
>> (Marcus Aurelius)
>>   
> 
> -- 
> Eik Vettorazzi
> Institut für Medizinische Biometrie und Epidemiologie
> Universitätsklinikum Hamburg-Eppendorf
> 
> Martinistr. 52
> 20246 Hamburg
> 
> T ++49/40/42803-8243
> F ++49/40/42803-7790
> 
> __
> 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.
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/contingency-table%2C-several-variables-from-dataframe-tp19775083p19778153.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.


[R] problems using AFDM(FactoMineR)

2008-10-15 Thread Birgitle

Hello R-list members!

I tried to do the following with my dataset that contains factor and
numerics, (80columns,about 600 rows)


Dataset.afdm<-AFDM(Dataset[282:595,], type=TypeVector, ncp=3)
Fehler in svd(X) : infinite or missing values in 'x'

TypeVector
 [1] "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"
"n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"
"n" "n" "n" "n" "n" "n" "n" "n"
[46] "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "s"
"s" "s" "s" "s" "s" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"



If I do

is.na(Dataset)
is.infinite(Dataset)

I get only FALSEs as answer or perhaps I should better say I can only see
FALSE but tha dataset is huge.
The given example for AFDM works.

Can somebody give me a hint, perhaps also how I could let me show only NA or
infinite values?
Many thanks for help in advance and sorry for not giving reproducible code
but there is maybe something going wrong with my dataset.

B.




-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/problems-using-AFDM%28FactoMineR%29-tp19998607p19998607.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.


[R] Problem installing ad administrating packages

2009-02-04 Thread Birgitle

Hello R-User!

I am running R 2.8.1 on an Intel Mac.
I just tried to install a package using the GUI and got the following error
message:
Fehler in if (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") >  : 
  Fehlender Wert, wo TRUE/FALSE nötig ist

Error in (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") >  :
  missing value, where TRUE/FALSE is necessary

also if I try to look at my installed packages using GUI

Fehler in .readRDS(pfile) : unbekanntes Eingabeformat

Error in .readRDS(pfile) : unknown enter format.

Some days ago I used a different working directory and now came back to my
usual one. Don`t know if this causes the error.

I would be very grateful if somebody could help me.

Many thanks in advance

B.



-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Problem-installing-ad-administrating-packages-tp21834632p21834632.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] Problem installing ad administrating packages

2009-02-05 Thread Birgitle

It is also not possible if I use this commands

install.packages("analogue","/Library/Frameworks/R.framework/Versions/2.8/Resources/library",repos="http://R-Forge.R-project.org";)
Fehler in .readRDS(pfile) : unbekanntes Eingabeformat

Error in .readRDS(pfile) : unknown enter format

also

library("ape",lib.loc="/Library/Frameworks/R.framework/Versions/2.8/Resources/library")

Error in .readRDS(pfile) : unknown enter format
Error in if (!noCache && file.exists(dest) && file.info(dest)$mtime >  : 
  missing value, where TRUE/FALSE is necessary

Error in .readRDS(pfile) : unbekanntes Eingabeformat
Fehler in if (!noCache && file.exists(dest) && file.info(dest)$mtime >  : 
  Fehlender Wert, wo TRUE/FALSE nötig ist

Please could somebody give me an advice. I can not do anything because I
need some packages.

Thanks

Birgit




Birgitle wrote:
> 
> Hello R-User!
> 
> I am running R 2.8.1 on an Intel Mac.
> I just tried to install a package using the GUI and got the following
> error message:
> Fehler in if (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") > 
> : 
>   Fehlender Wert, wo TRUE/FALSE nötig ist
> 
> Error in (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") >  :
>   missing value, where TRUE/FALSE is necessary
> 
> also if I try to look at my installed packages using GUI
> 
> Fehler in .readRDS(pfile) : unbekanntes Eingabeformat
> 
> Error in .readRDS(pfile) : unknown enter format.
> 
> Some days ago I used a different working directory and now came back to my
> usual one. Don`t know if this causes the error.
> 
> I would be very grateful if somebody could help me.
> 
> Many thanks in advance
> 
> B.
> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Problem-installing-ad-administrating-packages-tp21834632p21847159.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] Problem installing ad administrating packages

2009-02-05 Thread Birgitle

Solved:

I reinstalled R 2.8.1.

B.



Birgitle wrote:
> 
> It is also not possible if I use this commands
> 
> install.packages("analogue","/Library/Frameworks/R.framework/Versions/2.8/Resources/library",repos="http://R-Forge.R-project.org";)
> Fehler in .readRDS(pfile) : unbekanntes Eingabeformat
> 
> Error in .readRDS(pfile) : unknown enter format
> 
> also
> 
> library("ape",lib.loc="/Library/Frameworks/R.framework/Versions/2.8/Resources/library")
> 
> Error in .readRDS(pfile) : unknown enter format
> Error in if (!noCache && file.exists(dest) && file.info(dest)$mtime >  : 
>   missing value, where TRUE/FALSE is necessary
> 
> Error in .readRDS(pfile) : unbekanntes Eingabeformat
> Fehler in if (!noCache && file.exists(dest) && file.info(dest)$mtime >  : 
>   Fehlender Wert, wo TRUE/FALSE nötig ist
> 
> Please could somebody give me an advice. I can not do anything because I
> need some packages.
> 
> Thanks
> 
> Birgit
> 
> 
> 
> 
> Birgitle wrote:
>> 
>> Hello R-User!
>> 
>> I am running R 2.8.1 on an Intel Mac.
>> I just tried to install a package using the GUI and got the following
>> error message:
>> Fehler in if (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") > 
>> : 
>>   Fehlender Wert, wo TRUE/FALSE nötig ist
>> 
>> Error in (14 + nchar(dcall, type = "w") + nchar(sm[1], type = "w") >  :
>>   missing value, where TRUE/FALSE is necessary
>> 
>> also if I try to look at my installed packages using GUI
>> 
>> Fehler in .readRDS(pfile) : unbekanntes Eingabeformat
>> 
>> Error in .readRDS(pfile) : unknown enter format.
>> 
>> Some days ago I used a different working directory and now came back to
>> my usual one. Don`t know if this causes the error.
>> 
>> I would be very grateful if somebody could help me.
>> 
>> Many thanks in advance
>> 
>> B.
>> 
>> 
>> 
> 
> 


-
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: 
http://www.nabble.com/Problem-installing-ad-administrating-packages-tp21834632p21848545.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.