Dear Mr Signer and Mr Cleland,
 
Thanks a lot for you great help. However, the output which I am getting is as 
given below -
 






x

1;25

2;26

3;27

4;28

5;29

6;30

7;31

8;32

9;33

10;34

 ;35

 ;36

 ;37

 ;38

 ;39

 ;40

 ;41

 ;42

 ;43

 ;44

 ;45

 ;46

 ;47

 ;48

 ;49

 ;50
 
However, my requirement is I should get the csv file as
 
M             N
1             25
2             26
3             27 
................
 
10           34
               35
               36
               37

......................
......................
               50
 
So that I can acrry out further calcualtions on this output file. Please guide.
 
Regards
 
Maithili

--- On Fri, 4/12/09, Johannes Signer <j.m.sig...@gmail.com> wrote:


From: Johannes Signer <j.m.sig...@gmail.com>
Subject: Re: [R] writing 'output.csv' file
To: "Maithili Shiva" <maithili_sh...@yahoo.com>
Date: Friday, 4 December, 2009, 10:29 AM


Hello, 

maybe that helps:

write.csv(paste((c(m,rep(" ",length(N)-length(M)))),n, sep=";"), "output.csv", 
row.names=F)

Johannes


On Fri, Dec 4, 2009 at 11:12 AM, Maithili Shiva <maithili_sh...@yahoo.com> 
wrote:

Dear R helpers
 
Suppose
 
M <- c(1:10)      #  length(M) = 10
N <- c(25:50)     #  length(N) = 26 
 
I wish to have an outut file giving M and N. So I have tried
 
write.csv(data.frame(M, N), 'output.csv', row.names = FALSE)
 
but I get the following error message
 
Error in data.frame(M, N) :
  arguments imply differing number of rows: 10, 26
 
How do I modify my write.csv command to get my output in a single (csv) file 
irrespective of lengths.
 
Plese Guide
 
Thanks in advance
 
Maithili
 


     The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
       [[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.





[[elided Yahoo spam]]

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