Re: [R] Problem installing ad administrating packages

2009-02-05 Thread Birgitle
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

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

[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) +

[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

[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

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle
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

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle
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

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

[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

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

2008-09-03 Thread Birgitle
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

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

[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

[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

Re: [R] mob(party) formula question (example)

2008-08-13 Thread Birgitle
=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 data.frame ('data.frame': 288 obs. of 81 variables; factors, numerics and ordered factors) My response is a binary variable

Re: [R] mob(party) formula question

2008-08-13 Thread Birgitle
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

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

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

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

[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

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle
,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

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle
, 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

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

Re: [R] Problems using hetcor (polycor)

2008-08-07 Thread Birgitle
: ## 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

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

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.

[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

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

[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

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

[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

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

[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),

[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

[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),

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

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

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

[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

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

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

Re: [R] Delete NA from a dist object

2008-06-05 Thread Birgitle
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] 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

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

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

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

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