Re: [R] Reshape dataframe according to ordered variables

2010-03-18 Thread MORNEAU François
Hello Duarte,
It seems that order is what you are looking for :
df - df[order(df$id, df$ord), ] 
Regards,
François

-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De la 
part de Duarte Viana
Envoyé : jeudi 18 mars 2010 16:27
À : r-help
Objet : [R] Reshape dataframe according to ordered variables

Dear all,

I am still a R apprentice... Apologies for the basic question.
I am trying to reshape a dataframe based on the order of two variables
(a character variable and a numerical variable). To simplify it,
consider the following dataframe

 df-data.frame(id=c(b,b,a,a,a),ord=c(2,1,1,3,2))

  id ord
1  b   2
2  b   1
3  a   1
4  a   3
5  a   2

I want to reshape it such that it results in this dataframe (id
alphabetically ordered and ranked according to the ord order)

df1-data.frame(id=c(a,a,a,b,b),ord=c(1,2,3,1,2))

  id ord
1  a   1
2  a   2
3  a   3
4  b   1
5  b   2

Thanks in advance,

Duarte Viana

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

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


Re: [R] one long column of data - three small columns

2009-11-04 Thread MORNEAU François
Hello ?,
Have a look at ?matrix
matrix(c(2, 3, 4, 2, 1, 6, 6, 4, 7), ncol = 3)
François

-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De la 
part de frenchcr
Envoyé : mardi 3 novembre 2009 20:06
À : r-help@r-project.org
Objet : [R] one long column of data - three small columns


say i have a column of data like this...

2
3
4
2
1
6
6
4
7

and i want it in three columns like this

226
314
467

...so i can make a contour plot.


How do i do this?
-- 
View this message in context: 
http://old.nabble.com/one-long-column-of-data--%3E-three-small-columns-tp26163165p26163165.html
Sent from the R help mailing list archive at Nabble.com.

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

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


Re: [R] have the value of variable in a function

2009-07-31 Thread MORNEAU François
Hello,
Perhaps have a look at ?debug and ?browser... 
... and at fortune(159) in the 'fortunes' package ;)  !
Regards,
François

-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De la 
part de Inchallah Yarab
Envoyé : vendredi 31 juillet 2009 14:24
À : r-help@r-project.org
Objet : [R] have the value of variable in a function

hi ,

i need to know the value of variable used in a function i don't know if it is 
easy to do???

thank you


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

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


Re: [R] graph

2008-08-04 Thread MORNEAU François
Hello,

Is ?segments what you are looking for ?

François

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de elyakhlifi 
mustapha
Envoyé : vendredi 1 août 2008 17:15
À : r-help@r-project.org
Objet : [R] graph

Hello.
 
I don't know how to do to ouput segments between points like the chart attached.
Can you help me please?
Thanks.


  

.yahoo.fr

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