[R] this is not a list, not a data frame, but what ?

ruipbarradas at sapo.pt ruipbarradas at sapo.pt
Tue Feb 16 19:39:37 CET 2016


Hello,

What you want is a list of lists.
Try something like

Parameters <- list(PC_h_m = list(descript = "Point de convergence  
hauteur en metre", value = 5),
        PC_Q_m3 = list(descript = "Point de convergence debit en  
m3/s", value = 805.00))

Hope this helps,

Rui Barradas
 

Citando MAURICE Jean - externe <jean-externe.maurice at edf.fr>:

> HI,
> I am new to R and English is not my natural language.
>
> I am working on an old R application where there is a matrix  
> containing parameters. Something like :
> parametres=matrix(NA,15,3)
> parametres[1,1]<- "Point de convergence hauteur en metre"
> parametres[1,2]<- 5.00
> parametres[1,3]<- "PC_h_m"
> parametres[2,1]<- "Point de convergence debit en m3/s"
> parametres[2,2]<- 805.00
> parametres[2,3]<- "PC_Q_m3"
> and so on.
>> From 15 parameters, we shall reach 40.
>
> I'd like to be able to use something like
> Parameters$PC_h_m$descript to have "Point de convergence hauteur en metre"
> Parameters$PC_h_m$value to have 5
> Parameters$ PC_Q_m3$descript to have "Point de convergence debit en m3/s"
> Parameters$ PC_Q_m3$value to have 805.00
>
> It's a lot more 'readable' by humans ... Is it possible and, if yes, how ?
>
> Thanks in advance for your answers ...Jean in France

 

	[[alternative HTML version deleted]]



More information about the R-help mailing list