Re: [R] Extracting column value from csv file according to if else and & operator

2015-09-03 Thread shawin
I should extract the value according to the condition above

On Thu, Sep 3, 2015 at 7:57 AM, Navien [via R] <
ml-node+s789695n4711782...@n4.nabble.com> wrote:

> Hi all
> I have a csv file and i would like to extract the value of it with
> specific range fof the last column for example; F>2 & F<2 & P=1, and then
> write the result to csv file.
>
> the data is :
>
> x1 x2 x3 x4 x5 x6
> 9.488404 9.470895 9.282434 9.366707 9.955383 9.640816
> 8.63063 8.558311 8.788391 8.576231 8.671588 8.84298
> 9.354749 9.367669 9.259953 9.421538 9.554635 9.603745
> 9.944864 9.950428 10.19102 10.07351 10.0327 10.13079
> Fc p
> 1.037883 0.320095
> 1.057708 0.060132
> 1.065191 0.92
>
>
>
> I tried the code bellow but , it does not work?
>
> FCPval <-
> read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/FCPval.csv")
>
>  c=as.data.frame(FCPval)
>
> for (i in 1:rowN){if (C$F[i] >= 2 && C$F[i]<=-2&& C$p[i]<=3){
>
> dfrmPFC=data.frame(Fc=FC,p=p)}
> }
>
> the error is :
>
> Error in C$FC : object of type 'closure' is not subsettable.
>
> can i  extract the value according to the condition
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://r.789695.n4.nabble.com/Extracting-column-value-from-csv-file-according-to-if-else-and-operator-tp4711782.html
> To start a new topic under R help, email
> ml-node+s789695n789696...@n4.nabble.com
> To unsubscribe from R, click here
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=789695=c2hhd2lua2FyaW1AZ21haWwuY29tfDc4OTY5NXwtMjQ0MzkwMjQ1>
> .
> NAML
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://r.789695.n4.nabble.com/Extracting-column-value-from-csv-file-according-to-if-else-and-operator-tp4711782p4711783.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Converting CSV file to numeric and calculate ttest

2015-09-03 Thread shawin
dear Pikal , did you receive my last mail ?

On Thu, Sep 3, 2015 at 8:11 AM, PIKAL Petr [via R] <
ml-node+s789695n471178...@n4.nabble.com> wrote:

> Hi
>
> p value of what? How do you know that it should be 0.3?
>
> Your HTML post is mangled and almost unreadable.
>
> Your code is not reproducible, we do not have AT1.csv
>
> AT1 shall be numeric so your reading process is wrong and following
> conversion to numeric shall be umnnecessary if you read your data properly.
>
> Cheers
> Petr
>
> > -Original Message-
> > From: R-help [mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711784=0>] On Behalf Of
> shawin
> > Sent: Wednesday, September 02, 2015 9:08 PM
> > To: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4711784=1>
> > Subject: Re: [R] Converting CSV file to numeric and calculate ttest
> >
> > p value should be 0.3
> >
> > On Wed, Sep 2, 2015 at 8:07 PM, Navien [via R] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node=4711784=2>>
> wrote:
> >
> > > I have a csv file i convert it to numeric value , then i apply t-test
> > > , but t-test result is not correct: please could you guide me. the
> > data :
> > > ID x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 1367452_at
> > > 9.488404158 9.470895414 9.282433728 9.366707445 9.955383045
> > > 9.640816474 9.606262272 9.329651027 9.434541611 9.473922432
> > > 9.311412966
> > > 9.3154885 9.434977488 9.470895414 9.764258059 1367453_at 8.630629966
> > > 8.55831075 8.788391003 8.576231135 8.671587906
> > > 8.842979993 8.861958856 8.58330436 8.603596508 8.570129609 8.59798922
> > > 8.572686772 8.679751791 8.663950953 8.432875347 1367454_at
> > 9.354748885
> > > 9.367668838 9.259952558 9.421538213 9.554635162
> > > 9.603744578 9.452197983 9.284228877 9.404607878 9.317737979
> > > 9.343115301
> > > 9.310644266 9.27227486 9.360337823 9.44706281 1367455_at 9.944863964
> > > 9.950427516 10.19101759 10.07350804 10.03269879
> > > 10.1307908 10.03487287 9.74609383 9.886379007 9.775472567 10.036596
> > > 9.544738458 9.699611598 9.911962567 9.625804277
> > >   AT1 <-
> > > read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/AT1.csv",
> > >  stringsAsFactors=TRUE)
> > >
> > >
> > > str(AT1)
> > > matAT = data.frame(AT1[,-1])
> > > str(matAT)
> > > write.csv(matAT,"matAT.csv",row.names=FALSE)
> > > #convert the csv file to numeric
> > > matAT<-as.matrix(sapply(matAT,as.numeric))
> > > str(matAT)
> > > group<-factor(rep(c("Ob","Ln"),times=c(7,8)))
> > > t.test(matAT[1,]~group)
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > If you reply to this email, your message will be added to the
> > > discussion
> > > below:
> > >
> > > http://r.789695.n4.nabble.com/Converting-CSV-file-to-numeric-and-
> > calcu
> > > late-ttest-tp4711770.html To start a new topic under R help, email
> > > [hidden email] <http:///user/SendEmail.jtp?type=node=4711784=3>
> > > To unsubscribe from R, click here
> > >
> > <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscr
> > >
> > ibe_by_code=789695=c2hhd2lua2FyaW1AZ21haWwuY29tfDc4OTY5NXwtM
> > > jQ0MzkwMjQ1>
> > > .
> > > NAML
> > >
> > <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_vi
> > >
> > ewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces
> > > .BasicNamespace-nabble.view.web.template.NabbleNamespace-
> > nabble.naml.n
> > > amespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-
> > nabb
> > >
> > le.view.web.template.NodeNamespace=notify_subscribers%21na
> > > bble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-
> > send_instant_em
> > > ail%21nabble%3Aemail.naml>
> > >
> >
> >
> >
> >
> > --
> > View this message in context: http://r.789695.n4.nabble.com/Converting-
> > CSV-file-to-numeric-and-calculate-ttest-tp4711770p4711771.html
> > Sent from the R help mailing list archive at Nabble.com.
> >   [[alternative HTML version deleted]]
> >
> > __
> > [hidden email] <http:///user/SendEmail.jtp?type=node=4711784=4>
> mailing list -- To UNSUBSCRIBE and more, see
&

Re: [R] Converting CSV file to numeric and calculate ttest

2015-09-03 Thread shawin
Oh sorry F<2 & F<-2 ,  i need to extract the row value according to the
last two column F,P and using condition ,

I attached  an test file to see the data

On Thu, Sep 3, 2015 at 8:43 AM, PIKAL Petr [via R] <
ml-node+s789695n4711787...@n4.nabble.com> wrote:

> Hi
>
> what is F?
>
> F>2 & F<2
> this is FALSE for all values of F
>
> What value you want to extract? All rows corresponding to condition or
> just values from specific column.
>
> For selection values you can use e.g. [
> data(iris)
> sel<-iris$Sepal.Width>4
> iris[sel,] or iris[sel, c(1,3,5)]
>
> Cheers
> Petr
>
> From: Shawin Karim [mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711787=0>]
> Sent: Thursday, September 03, 2015 9:17 AM
> To: PIKAL Petr
> Subject: Re: [R] Converting CSV file to numeric and calculate ttest
>
> I solve it , thanks  but i have an issue please :
>
>
> have a csv file and i would like to extract the value of it with specific
> range fof the last column for example; F>2 & F<2 & P=1, and then write the
> result to csv file.
>
> the data is :
> x1
>
> x2
>
> x3
>
> x4
>
> x5
>
> x6
>
> 9.488404
>
> 9.470895
>
> 9.282434
>
> 9.366707
>
> 9.955383
>
> 9.640816
>
> 8.63063
>
> 8.558311
>
> 8.788391
>
> 8.576231
>
> 8.671588
>
> 8.84298
>
> 9.354749
>
> 9.367669
>
> 9.259953
>
> 9.421538
>
> 9.554635
>
> 9.603745
>
> 9.944864
>
> 9.950428
>
> 10.19102
>
> 10.07351
>
> 10.0327
>
> 10.13079
>
>
> Fc
>
> p
>
> 1.037883
>
> 0.320095
>
> 1.057708
>
> 0.060132
>
> 1.065191
>
> 0.92
>
>
>
>
> I tried the code bellow but , it does not work?
>
> FCPval <-
> read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/FCPval.csv")
>
>  c=as.data.frame(FCPval)
>
> for (i in 1:rowN){if (C$F[i] >= 2 && C$F[i]<=-2&& C$p[i]<=3){
>
> dfrmPFC=data.frame(Fc=FC,p=p)}
> }
>
> the error is :
>
> Error in C$FC : object of type 'closure' is not subsettable.
>
> can i  extract the value according to the condition
>
> On Thu, Sep 3, 2015 at 8:14 AM, PIKAL Petr <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711787=1><mailto:[hidden
> email] <http:///user/SendEmail.jtp?type=node=4711787=2>>> wrote:
> Hi
>
> p value of what? How do you know that it should be 0.3?
>
> Your HTML post is mangled and almost unreadable.
>
> Your code is not reproducible, we do not have AT1.csv
>
> AT1 shall be numeric so your reading process is wrong and following
> conversion to numeric shall be umnnecessary if you read your data properly.
>
> Cheers
> Petr
>
> > -Original Message-
> > From: R-help [mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711787=3><mailto:[hidden
> email] <http:///user/SendEmail.jtp?type=node=4711787=4>>] On
> Behalf Of shawin
> > Sent: Wednesday, September 02, 2015 9:08 PM
> > To: [hidden email]
> <http:///user/SendEmail.jtp?type=node=4711787=5><mailto:[hidden
> email] <http:///user/SendEmail.jtp?type=node=4711787=6>>
> > Subject: Re: [R] Converting CSV file to numeric and calculate ttest
> >
> > p value should be 0.3
> >
> > On Wed, Sep 2, 2015 at 8:07 PM, Navien [via R] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node=4711787=7>
> <mailto:ml-node%[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711787=8>>> wrote:
> >
> > > I have a csv file i convert it to numeric value , then i apply t-test
> > > , but t-test result is not correct: please could you guide me. the
> > data :
> > > ID x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 1367452_at
> > > 9.488404158 9.470895414 9.282433728 9.366707445 9.955383045
> > > 9.640816474 9.606262272 9.329651027 9.434541611 9.473922432
> > > 9.311412966
> > > 9.3154885 9.434977488 9.470895414 9.764258059 1367453_at 8.630629966
> > > 8.55831075 8.788391003 8.576231135 8.671587906
> > > 8.842979993 8.861958856 8.58330436 8.603596508 8.570129609 8.59798922
> > > 8.572686772 8.679751791 8.663950953 8.432875347 1367454_at
> > 9.354748885
> > > 9.367668838 9.259952558 9.421538213 9.554635162
> > > 9.603744578 9.452197983 9.284228877 9.404607878 9.317737979
> > > 9.343115301
> > > 9.310644266 9.27227486 9.360337823 9.44706281 1367455_at 9.944863964
> > > 9.950427516 10.19101759 10.07350804 10.03269879
> > > 

Re: [R] Converting CSV file to numeric and calculate ttest

2015-09-03 Thread shawin
Dear Petr,

This code does not work ?
For selection values you can use e.g. [
data(iris)
sel<-iris$Sepal.Width>4
iris[sel,] or iris[sel, c(1,3,5)]


the data is csv file which is :
FCPval <- read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/FCPval.csv")

;

Fc2<-(FCPVal$Fc>=2 | FCPval<=-2);  this will just come out , true false
 not extracting the Fc  ,
#
FCP<-as.matrix(sapply(FCPval,as.numeric))
A=as.data.frame(FCP)
Fc2<-(A$Fc>=1.3| A$Fc<=-1.3) & A$p=0.05;  // has error when i combine
condition

Error in (Fc2 <- (A$Fc >= 1.3 | A$Fc <= -1.3) & A$p) = 0.05 :
  could not find function "<-<-"

write.csv(Fc2,"Fc2.csv",row.names =FALSE )

please need help


On Thu, Sep 3, 2015 at 8:56 AM, Shawin Karim <shawinka...@gmail.com> wrote:

> Oh sorry F<2 & F<-2 ,  i need to extract the row value according to the
> last two column F,P and using condition ,
>
> I attached  an test file to see the data
>
> On Thu, Sep 3, 2015 at 8:43 AM, PIKAL Petr [via R] <
> ml-node+s789695n4711787...@n4.nabble.com> wrote:
>
>> Hi
>>
>> what is F?
>>
>> F>2 & F<2
>> this is FALSE for all values of F
>>
>> What value you want to extract? All rows corresponding to condition or
>> just values from specific column.
>>
>> For selection values you can use e.g. [
>> data(iris)
>> sel<-iris$Sepal.Width>4
>> iris[sel,] or iris[sel, c(1,3,5)]
>>
>> Cheers
>> Petr
>>
>> From: Shawin Karim [mailto:[hidden email]
>> <http:///user/SendEmail.jtp?type=node=4711787=0>]
>> Sent: Thursday, September 03, 2015 9:17 AM
>> To: PIKAL Petr
>> Subject: Re: [R] Converting CSV file to numeric and calculate ttest
>>
>> I solve it , thanks  but i have an issue please :
>>
>>
>> have a csv file and i would like to extract the value of it with specific
>> range fof the last column for example; F>2 & F<2 & P=1, and then write the
>> result to csv file.
>>
>> the data is :
>> x1
>>
>> x2
>>
>> x3
>>
>> x4
>>
>> x5
>>
>> x6
>>
>> 9.488404
>>
>> 9.470895
>>
>> 9.282434
>>
>> 9.366707
>>
>> 9.955383
>>
>> 9.640816
>>
>> 8.63063
>>
>> 8.558311
>>
>> 8.788391
>>
>> 8.576231
>>
>> 8.671588
>>
>> 8.84298
>>
>> 9.354749
>>
>> 9.367669
>>
>> 9.259953
>>
>> 9.421538
>>
>> 9.554635
>>
>> 9.603745
>>
>> 9.944864
>>
>> 9.950428
>>
>> 10.19102
>>
>> 10.07351
>>
>> 10.0327
>>
>> 10.13079
>>
>>
>> Fc
>>
>> p
>>
>> 1.037883
>>
>> 0.320095
>>
>> 1.057708
>>
>> 0.060132
>>
>> 1.065191
>>
>> 0.92
>>
>>
>>
>>
>> I tried the code bellow but , it does not work?
>>
>> FCPval <-
>> read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/FCPval.csv")
>>
>>  c=as.data.frame(FCPval)
>>
>> for (i in 1:rowN){if (C$F[i] >= 2 && C$F[i]<=-2&& C$p[i]<=3){
>>
>> dfrmPFC=data.frame(Fc=FC,p=p)}
>> }
>>
>> the error is :
>>
>> Error in C$FC : object of type 'closure' is not subsettable.
>>
>> can i  extract the value according to the condition
>>
>> On Thu, Sep 3, 2015 at 8:14 AM, PIKAL Petr <[hidden email]
>> <http:///user/SendEmail.jtp?type=node=4711787=1><mailto:[hidden
>> email] <http:///user/SendEmail.jtp?type=node=4711787=2>>> wrote:
>> Hi
>>
>> p value of what? How do you know that it should be 0.3?
>>
>> Your HTML post is mangled and almost unreadable.
>>
>> Your code is not reproducible, we do not have AT1.csv
>>
>> AT1 shall be numeric so your reading process is wrong and following
>> conversion to numeric shall be umnnecessary if you read your data properly.
>>
>> Cheers
>> Petr
>>
>> > -Original Message-
>> > From: R-help [mailto:[hidden email]
>> <http:///user/SendEmail.jtp?type=node=4711787=3><mailto:[hidden
>> email] <http:///user/SendEmail.jtp?type=node=4711787=4>>] On
>> Behalf Of shawin
>> > Sent: Wednesday, September 02, 2015 9:08 PM
>> > To: [hidden email]
>> <http:///user/SendEmail.jtp?type=node=4711

Re: [R] reading files with name columns and row columns

2015-09-02 Thread shawin
dear William ,

I have an issue with R code which is :


FCP<-as.matrix(sapply(FCPval,as.numeric))
for (i in 1:rowN){if (FCP$FC[i] >= 1.5 & FCP$FC[i]<=-1.5 & FCP$p[i]<=0.05){
dfrmPFC=data.frame(matrix(Fc=FC,p=p))}
}

the error is :Error in FCP$FC : $ operator is invalid for atomic vectors
could you please help me

On Thu, Sep 3, 2015 at 12:32 AM, William Dunlap [via R] <
ml-node+s789695n4711779...@n4.nabble.com> wrote:

>   y <- as.matrix(read.table("FILE_NAME",header=T,row.names=1))
>   colnames(y) <- gsub("X","", colnames(y))
>
> Use read.table's check.names=FALSE argument so it won't mangle
> the column names instead of trying to demangle them with gsub()
> afterwards.
>
> E.g.,
>   txt <- "   50%  100%\nA   5 8\nB  1314\n"
>   cat(txt)
>   #   50%  100%
>   #A   5 8
>   #B  1314
>   read.table(text=txt, head=TRUE, row.names=1)
>   #  X50. X100.
>   #A5 8
>   #B   1314
>   read.table(text=txt, head=TRUE, row.names=1, check.names=FALSE)
>   #  50% 100%
>   #A   58
>   #B  13   14
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Wed, Sep 2, 2015 at 4:08 PM, Bogdan Tanasa <[hidden email]
> > wrote:
>
> > Thanks, Bert ! I solved the situation in the meanwhile, by using :
> >
> > y <- as.matrix(read.table("FILE_NAME",header=T,row.names=1))
> >
> > colnames(y) <- gsub("X","", colnames(y))
> >
> >
> > On Wed, Sep 2, 2015 at 3:59 PM, Bert Gunter <[hidden email]
> >
> > wrote:
> >
> > > Please read the Help file carefully before posting:
> > >
> > > "read.table is not the right tool for reading large matrices,
> > > especially those with many columns: it is designed to read data frames
> > > which may have columns of very different classes. Use scan instead for
> > > matrices."
> > >
> > > But the answer to your question can be found in
> > >
> > > ?make.names
> > >
> > > for what constitutes a syntactically valid name in R.
> > >
> > >
> > > Cheers,
> > > Bert
> > >
> > > Bert Gunter
> > >
> > > "Data is not information. Information is not knowledge. And knowledge
> > > is certainly not wisdom."
> > >-- Clifford Stoll
> > >
> > >
> > > On Wed, Sep 2, 2015 at 3:11 PM, Bogdan Tanasa <[hidden email]
> > wrote:
> > > > Dear all,
> > > >
> > > > would appreciate a piece of help with a simple question: I am
> reading
> > in
> > > R
> > > > a file that is formatted as a matrix (an example is shown below,
> > although
> > > > it is more complex, a matrix of 1000 * 1000 ):
> > > >
> > > > the names of the columns are 0, 1, 4, 8, etc
> > > > the names of the rows are 0, 1, 4, 8, etc
> > > >
> > > >0 20 40
> > > > 0  0   0   0
> > > > 20  0   0   0
> > > > 40  0   0   0
> > > >
> > > > shall I use the command :
> > > >
> > > > y <- read.table("file",row.names=1, header=T)
> > > >
> > > > the results is :
> > > >
> > > >> y[1:3,1:3]
> > > >X0 X20 X40
> > > > 0   0   0   0
> > > > 20  0   0   0
> > > > 40  0   0   0
> > > >
> > > > The question is : why R adds an X to the names of the columns eg X0,
> > > > X2, X4, when it shall be only 0, 2, 4 ? thanks !
> > > >
> > > > -- bogdan
> > > >
> > > > [[alternative HTML version deleted]]
> > > >
> > > > __
> > > > [hidden email]
>  mailing list --
> To UNSUBSCRIBE and more, see
> > > > 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]]
> >
> > __
> > [hidden email] 
> mailing list -- To UNSUBSCRIBE and more, see
> > 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]]
>
> __
> [hidden email] 
> mailing list -- To UNSUBSCRIBE and more, see
> 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.
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://r.789695.n4.nabble.com/reading-files-with-name-columns-and-row-columns-tp4711774p4711779.html
> To start a new topic under R help, email
> ml-node+s789695n789696...@n4.nabble.com
> To 

Re: [R] reading files with name columns and row columns

2015-09-02 Thread shawin
also the header =0

On Wed, Sep 2, 2015 at 11:52 PM, Shawin Karim <shawinka...@gmail.com> wrote:

> make row.name=0 instead to 1
>
> On Wed, Sep 2, 2015 at 11:07 PM, Bogdan Tanasa [via R] <
> ml-node+s789695n4711774...@n4.nabble.com> wrote:
>
>> Dear all,
>>
>> would appreciate a piece of help with a simple question: I am reading in
>> R
>> a file that is formatted as a matrix (an example is shown below, although
>> it is more complex, a matrix of 1000 * 1000 ):
>>
>> the names of the columns are 0, 1, 4, 8, etc
>> the names of the rows are 0, 1, 4, 8, etc
>>
>>0 20 40
>> 0  0   0   0
>> 20  0   0   0
>> 40  0   0   0
>>
>> shall I use the command :
>>
>> y <- read.table("file",row.names=1, header=T)
>>
>> the results is :
>>
>> > y[1:3,1:3]
>>X0 X20 X40
>> 0   0   0   0
>> 20  0   0   0
>> 40  0   0   0
>>
>> The question is : why R adds an X to the names of the columns eg X0,
>> X2, X4, when it shall be only 0, 2, 4 ? thanks !
>>
>> -- bogdan
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> [hidden email] <http:///user/SendEmail.jtp?type=node=4711774=0>
>> mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://r.789695.n4.nabble.com/reading-files-with-name-columns-and-row-columns-tp4711774.html
>> To start a new topic under R help, email
>> ml-node+s789695n789696...@n4.nabble.com
>> To unsubscribe from R, click here
>> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=789695=c2hhd2lua2FyaW1AZ21haWwuY29tfDc4OTY5NXwtMjQ0MzkwMjQ1>
>> .
>> NAML
>> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>




--
View this message in context: 
http://r.789695.n4.nabble.com/reading-files-with-name-columns-and-row-columns-tp4711774p4711776.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Converting CSV file to numeric and calculate ttest

2015-09-02 Thread shawin
p value should be 0.3

On Wed, Sep 2, 2015 at 8:07 PM, Navien [via R] <
ml-node+s789695n4711770...@n4.nabble.com> wrote:

> I have a csv file i convert it to numeric value , then i apply t-test ,
> but t-test result is not correct: please could you guide me. the data :
> ID x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15
> 1367452_at 9.488404158 9.470895414 9.282433728 9.366707445 9.955383045
> 9.640816474 9.606262272 9.329651027 9.434541611 9.473922432 9.311412966
> 9.3154885 9.434977488 9.470895414 9.764258059
> 1367453_at 8.630629966 8.55831075 8.788391003 8.576231135 8.671587906
> 8.842979993 8.861958856 8.58330436 8.603596508 8.570129609 8.59798922
> 8.572686772 8.679751791 8.663950953 8.432875347
> 1367454_at 9.354748885 9.367668838 9.259952558 9.421538213 9.554635162
> 9.603744578 9.452197983 9.284228877 9.404607878 9.317737979 9.343115301
> 9.310644266 9.27227486 9.360337823 9.44706281
> 1367455_at 9.944863964 9.950427516 10.19101759 10.07350804 10.03269879
> 10.1307908 10.03487287 9.74609383 9.886379007 9.775472567 10.036596
> 9.544738458 9.699611598 9.911962567 9.625804277
>   AT1 <-
> read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/AT1.csv",
>  stringsAsFactors=TRUE)
>
>
> str(AT1)
> matAT = data.frame(AT1[,-1])
> str(matAT)
> write.csv(matAT,"matAT.csv",row.names=FALSE)
> #convert the csv file to numeric
> matAT<-as.matrix(sapply(matAT,as.numeric))
> str(matAT)
> group<-factor(rep(c("Ob","Ln"),times=c(7,8)))
> t.test(matAT[1,]~group)
>
>
>
>
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://r.789695.n4.nabble.com/Converting-CSV-file-to-numeric-and-calculate-ttest-tp4711770.html
> To start a new topic under R help, email
> ml-node+s789695n789696...@n4.nabble.com
> To unsubscribe from R, click here
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=789695=c2hhd2lua2FyaW1AZ21haWwuY29tfDc4OTY5NXwtMjQ0MzkwMjQ1>
> .
> NAML
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://r.789695.n4.nabble.com/Converting-CSV-file-to-numeric-and-calculate-ttest-tp4711770p4711771.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Median on second group of CSV file produce Na

2015-09-01 Thread shawin
The str() out come is :

chr [1:31099, 1:8] " 9.329651" " 8.583304" " 9.284229" " 9.746094"
"10.200084" " 9.249863" " 7.979661" "11.271934" ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:8] "GSM215579.CEL" "GSM215580.CEL" "GSM215581.CEL"
"GSM215582.CEL" ...

On Tue, Sep 1, 2015 at 2:32 PM, Michael Dewey-3 [via R] <
ml-node+s789695n4711716...@n4.nabble.com> wrote:

> What happened when you did summary(y) or str(y)?
>
> On 01/09/2015 08:57, Navien wrote:
>
> > Dear Michael ,
> >
> > Thank you very much for your reply , kindly  please can i send you the
> > program and data please , y is shown a normal csv file no issue with it
> :(
> >
> >
> > Kind Regards
> >
> > On Tue, Sep 1, 2015 at 8:36 AM, Michael Dewey-3 [via R] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node=4711716=0>>
> wrote:
> >
> >> Dear Shawin
> >>
> >> You probably did not get an answer because
> >> 1 - you seem to have posted in HTML which mangled your post into
> >> unreadability
> >> 2 - there seem to be lots of lines which do not do anything germane to
> >> the problem.
> >>
> >> Why not try summary(y) or str(y) before you convert it to a matrix and
> >> see what it says?
> >>
> >> On 31/08/2015 20:46, shawin wrote:
> >>
> >>> I have an issue ans i posted it , so i would like to receive a
> solution
> >>> please
> >>>
> >>> On Mon, Aug 31, 2015 at 8:35 PM, shawin [via R] <
> >>> [hidden email] <http:///user/SendEmail.jtp?type=node=4711707=0>>
>
> >> wrote:
> >>>
> >>>> I have a data frame  csv file and I'm trying to calculate median for
> >> each
> >>>> group separately row by row . When I separate the data frame in two
> >> groups
> >>>> and calculate the median for each one, I am getting an NA result for
> >> the
> >>>> second group :
> >>>> the data
> >>>> x1  x2  x3  x4  x5  x6  x7  y1  y2  y3  y4  y5  y6  y7  y8
> >>>> 9.488404158 9.470895414 9.282433728 9.366707445 9.955383045
> 9.640816474
> >>>> 9.606262272   9.329651027 9.434541611 9.473922432 9.311412966
> 9.3154885
> >>>> 9.434977488 9.470895414 9.764258059
> >>>> 8.630629966 8.55831075  8.788391003 8.576231135 8.671587906
> 8.842979993
> >>>> 8.861958856 8.58330436  8.603596508 8.570129609 8.59798922
>  8.572686772
> >>>> 8.679751791 8.663950953 8.432875347
> >>>> 9.354748885 9.367668838 9.259952558 9.421538213 9.554635162
> 9.603744578
> >>>> 9.452197983 9.284228877 9.404607878 9.317737979 9.343115301
> 9.310644266
> >>>> 9.27227486  9.360337823 9.44706281
> >>>> 9.944863964 9.950427516 10.19101759 10.07350804 10.03269879
> 10.1307908
> >>>>10.03487287 9.74609383  9.886379007 9.775472567 10.036596
> >> 9.544738458
> >>>> 9.699611598 9.911962567
> >>>> 9.625804277
> >>>>
> >>>>
> >>>>  Code:
> >>>>
> >>>>  rowN <- nrow(AT1)
> >>>>  MD1<-vector(length=rowN)
> >>>> MD2<-vector(length=rowN)
> >>>>
> >>>> MD1[1:rowN]<-NA
> >>>> MD2[1:rowN]<-NA
> >>>>
> >>>>
> >>>>x<- AT1[,c(2,3,4,5,6,7,8) ]
> >>>>   write.csv(x,"x.csv",row.names=TRUE)
> >>>>x<-as.matrix(x)
> >>>>   for(i in 2:rowN) {
> >>>>  MD1[i]=median(x[i,])
> >>>> }
> >>>>write.csv(MD1,"MD1.csv",row.names=TRUE)
> >>>>
> >>>>y<- AT1[,c(9,10,11,12,13,14,15,16)]
> >>>>write.csv(y,"y.csv",row.names=TRUE)
> >>>>y<-as.matrix(y)
> >>>>for(j in 2:rowN) {
> >>>>MD2[j]=median(y[j,])
> >>>> }
> >>>>write.csv(MD2,"MD2.csv",row.names=TRUE)
> >>>>
> >>>>
> >>>> --
> >>>> If you reply to this email, your message will be added to the
&

Re: [R] Median on second group of CSV file produce Na

2015-08-31 Thread shawin
I have an issue ans i posted it , so i would like to receive a solution
please

On Mon, Aug 31, 2015 at 8:35 PM, shawin [via R] <
ml-node+s789695n4711689...@n4.nabble.com> wrote:

> I have a data frame  csv file and I'm trying to calculate median for each
> group separately row by row . When I separate the data frame in two groups
> and calculate the median for each one, I am getting an NA result for the
> second group :
> the data
>   x1  x2  x3  x4  x5  x6  x7  y1  y2  y3  y4  y5  y6  y7  y8
> 9.488404158 9.470895414 9.282433728 9.366707445 9.955383045 9.640816474
> 9.606262272   9.329651027 9.434541611 9.473922432 9.311412966 9.3154885
> 9.434977488 9.470895414 9.764258059
> 8.630629966 8.55831075  8.788391003 8.576231135 8.671587906 8.842979993
> 8.861958856 8.58330436  8.603596508 8.570129609 8.59798922  8.572686772
> 8.679751791 8.663950953 8.432875347
> 9.354748885 9.367668838 9.259952558 9.421538213 9.554635162 9.603744578
> 9.452197983 9.284228877 9.404607878 9.317737979 9.343115301 9.310644266
> 9.27227486  9.360337823 9.44706281
> 9.944863964 9.950427516 10.19101759 10.07350804 10.03269879 10.1307908
>  10.03487287 9.74609383  9.886379007 9.775472567 10.036596   9.544738458
> 9.699611598 9.911962567
> 9.625804277
>
>
>Code:
>
>rowN <- nrow(AT1)
>MD1<-vector(length=rowN)
>   MD2<-vector(length=rowN)
>
>   MD1[1:rowN]<-NA
>   MD2[1:rowN]<-NA
>
>
>  x<- AT1[,c(2,3,4,5,6,7,8) ]
> write.csv(x,"x.csv",row.names=TRUE)
>  x<-as.matrix(x)
> for(i in 2:rowN) {
>MD1[i]=median(x[i,])
>   }
>  write.csv(MD1,"MD1.csv",row.names=TRUE)
>
>  y<- AT1[,c(9,10,11,12,13,14,15,16)]
>  write.csv(y,"y.csv",row.names=TRUE)
>  y<-as.matrix(y)
>  for(j in 2:rowN) {
>  MD2[j]=median(y[j,])
>   }
>  write.csv(MD2,"MD2.csv",row.names=TRUE)
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://r.789695.n4.nabble.com/Median-on-second-group-of-CSV-file-produce-Na-tp4711689.html
> To start a new topic under R help, email
> ml-node+s789695n789696...@n4.nabble.com
> To unsubscribe from R, click here
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=789695=c2hhd2lua2FyaW1AZ21haWwuY29tfDc4OTY5NXwtMjQ0MzkwMjQ1>
> .
> NAML
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://r.789695.n4.nabble.com/Median-on-second-group-of-CSV-file-produce-Na-tp4711689p4711690.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.