[R] max

2008-07-29 Thread Paul Adams
Hello everyone, I have a vector of p-values and I am trying to find the max for the vector and add it to a list.I am using a loop to loop through 50 times.I have used the following code but it does not pick out the max and add to the list.Any help would be appreciated.  

[R] accessing list elements

2008-07-29 Thread Paul Adams
Hello everyone, I have a list which I am trying to calculate a max value.I have the list as w-c(v[[1]][1],...v[[100]][1]). The problem I am getting is that the function max is saying the list is an invalid type (list) of  argument.When I show the element v[[1]][1] it shows as

[R] list

2008-07-28 Thread Paul Adams
I have run a wilcox test on a dataframe and I have returned to me data which I am wanting to sort and/or pick the max. I have tried the following code to pick the max: v-wilcox.test.run w-max(v,na.rm=FALSE)   I have also tried w-pmax(p-value,na.rm=FALSE) for the second line   and this returns the

[R] error in test

2008-07-25 Thread Paul Adams
Hello everyone, I am trying to use the following code: dat-read.table(file=C:\\Documents.txt) class2-read.table(file=C:\\Documents.txt) class1-read.table(file=C:\\Documents .txt) dat-as.data.frame(dat) dimnames(dat)[[1]]-paste(g,c(1:nrow(dat)),sep=)

[R] (no subject)

2008-07-13 Thread Paul Adams
Hello everyone, I am using the following code to try to calculate the mean : dat-read.table(file=C:\\Documents and  Settings.txt) dat-as.numeric(dat) x1.mmean(dat) I am getting the following error message Error in eval.with.vis(expr,envir,enclos): (list) object cannot be coerced to typedouble'

[R] Plot

2008-07-08 Thread Paul Adams
Hello everyone, I am trying to plot an MvA plot with the following code: dat-read.table(file=C:\\Documents and Settings\\.txt,header=T) file.show(file=C:\\Documents and Settings\\Ow...txt) library(sma) data(MouseArray) dat.o-as.list(dat) dat.o$R.2-as.matrix(dat[,c(1:5)])

[R] boxplot colors

2008-06-22 Thread Paul Adams
Hello everyone, I am trying to color two boxplots on the same graph two different colors. I have tried the following boxplot(5,1:19,5,20:39,col=c(red,blue)) but all I get are two blue boxes. Any help would be appreciated Paul [[alternative HTML version deleted]]

[R] boxplot problem

2008-06-21 Thread Paul Adams
Hello everyone, I am trying to plot a boxplot but am coming up with the error : could not find function dat I have used the following code. dat-read.table(file=C:\\Documents and Settings\\...txt,header=T,row.names=1,blank.lines.skip=F,na.strings=NA) file.show(file=C:\\Documents and

[R] matrix

2008-06-18 Thread Paul Adams
Hello everyone,I am having a difficult time understanding what commands are used to add and remove elements froma matrix or data frame.For ex ample if I want to remove element=[1,50] or elements [1,50:63] or elements  [2:4,20:35]from a matrix and replace with NA or any number what command must

[R] (no subject)

2008-06-18 Thread Paul Adams
Hello everyone, I am wanting to replace an element in a matrix with NA. I have used the following code dat-read.table(file=C:\\Documents and Settings\\txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\txt) Z.matrix-as.matrix(dat) Y-dat[,46:63] X-dat[1,51] dat[1,51]-NA

[R] replace column headers

2008-06-17 Thread Paul Adams
Hello everyone,=I have a question as to how to remove the column headers in a data file and then replace those with titles from another file in this case the file labeled ann  ( in which the titles are all in one column).I am unsure which function to use.I tried rm () to remove the column

[R] array elements incorrect

2008-06-17 Thread Paul Adams
Hello everyone, I have a question as to what code should be used if one wanted to subset from a dataframe of 7000rows by 38 columns.For example if you wanted to generate a array of 100 by 38 would you not use the following: Z-(dat,dim=c(100,38)) where dat is the dataframe of 7000by 38 Whenever I

[R] error in casting matrix

2008-06-17 Thread Paul Adams
Hello everyone, I am trying to cast a data frame to a matrix I have used the following code: dat-read.table(file=C:\\Documents and Settings\.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settingt.txt) Z.matrix-as.matrix(dat.data.frame) but I keep getting the error error in

[R] error in dat

2008-06-16 Thread Paul Adams
Hello everyone, I have the following code which keeps giving me an error. The code is: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\eisen.txt,header=T,row.names=1,blank.lines.skip=F,na..strings=NA) dimnames(dat)((1)) -as.character(dat(,1)) dat-dat(,-1)

[R] histogram

2008-06-13 Thread Paul Adams
Hello everyone, I am trying to plot a histogram from the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt) x-dat[2,23:46]

[R] computing and showing mean

2008-06-11 Thread Paul Adams
Hello to everyone, I am trying to compute a mean and show it to the screen and then save to later be used as a boxplot.I have used the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and

[R] eliminating and relabeling the first column

2008-06-07 Thread Paul Adams
Hello everyone, I have a data frame in which I am wanting to eliminate the row labels and then relabel the rows with g1-g2000.I have used the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt,header=T,row.names=1) file.show(file=C:\\Documents

[R] error message with dat

2008-06-06 Thread Paul Adams
Hello everyone, I have two problems which I am unable to solve : 1.I am trying to add the  row labels (g1-g2000) to the very left of a data table. The data table is 2000 rows  by 62 columns.I have used the following code. read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\colon

[R] adding column and pulling data from table

2008-06-03 Thread Paul Adams
Hello to everyone, I have a general question about how to add a column to a table.I have a table that has 62 columns and 2000 rows.I am wanting to add a column on the left most row.I am wanting to label the rows g1 to g2000 I have the code of (g,c(1:nrow(dat)),sep=) for the right side of the

[R] print and read.table commands

2008-06-02 Thread Paul Adams
  Hello to everyone, I am new to programming in R and am having trouble with the following two commands 1.I am running a simple 1 line script read.table(file=C:\\Document and Settings\\All Users\\Desktop\\colon cancer.txt) and the error message I get is Error in file (file, r): cannot open the

[R] more columns that column names

2008-06-02 Thread Paul Adams
Hello to everyone, I have gotten my file to print to screen but when I use read.table I am getting an error message that says there are more columns than column names.This is a file that was not created by me so I am not sure how to investigate and solve this problem.I looked in the help file