Hi!

I don't really understand why you do pcrdata<-as.data.frame(t(pcrdata))
Do you need to transpose the dataset? Because read.csv() creates a 
dataframe already.

Something I found really useful recently is the package xlsReadWrite 
where the function read.xls() has an argument colClasses (read.table() 
and read.csv() have it too, but it never worked fine for me) which would 
allow you to specify the class of each column at reading.

Is this what you were looking for or am I completely wrong?

By the way, you could send us the output from str(pcrdata), I mean just 
after reading in the data

Ivan


Le 3/17/2010 15:23, Michael Glanville a écrit :
> I am currently trying to write a program that minimises the amount of work
> required for "auditable" qPCR data. At the moment I am using an Excel (.csv)
> spreadsheet as source data that has been transposed to the column format
> required for R to read. Unfortunately, this means I have* *to manually
> confirm the whole data set prior to doing any analysis, which is taking a
> considerable amount of time! My idea now is to read the raw data in directly
> and get R to do the transformation prior to analysis. The problem I now have
> is that, upon transposition, the data are converted to "character" in a
> matrix, rather than "factor" and "numeric" in a dataframe. I have succeeded
> in changing the matrix to a dataframe (via as.data.frame(object)), but this
> then converts all the data to "factor" which I can't use for my analysis
> since, other than the column headings, I need the data to be numeric. I have
> tried coercing the data to numeric using the as() and as.numeric() commands,
> but this has no effect on the data format. I have no experience in
> programming and so am at a loss as to what to do: am I making a basic error
> in my programming or missing something essential (or both!)?
>
>
>
> I am using R version 2.9.0 at the moment, but this will change as soon as I
> have sorted this issue out. Below is the code I have put together, as you
> can see it is VERY brief but essential to allow my analysis to proceed:
>
>
>
> pcrdata<-read.csv("File_path",header=FALSE)
>
> pcrdata<-as.data.frame(t(pcrdata))
>
> pcrdata[2:51]<-as.numeric(as.character(pcrdata))
>
>
>
> Any help would be gratefully appreciated,
>
>
>
> Mike Glanville
>
>       [[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.
>    

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calan...@uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php


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

Reply via email to