Skip to content
Back to formatted view

Raw Message

Message-ID: <4B5ADAD8.7080506@biostat.ku.dk>
Date: 2010-01-23T11:17:44Z
From: Peter Dalgaard
Subject: R and Limesurvey
In-Reply-To: <20100123105232.GA6069@smtp.free.fr>

Fabrice DELENTE wrote:
> Hello.
> 
> I used Limesurvey to get answers to a survey. Now I need to process the data
> collected.
> 
> I exported the R syntax file describing the survey structure, the file is a 
> 
> http://fdelente.free.fr/Surveydata_syntax.R
> 
> It contains lines like
> 
> attributes(data)$variable.labels[which(names(data)=="V5")]="Quel ?ge avez-vous ?"
> 
> that are the clear text of my question.
> 
> I'd like to be able to reference these values to display them.
> 
> I tried print(attributes(data)$variable.labels["V5"] but it gives NA whereas
> I'd like to get "Quel ?ge avez-vous ?".
> 
> How does this work?

Hmm, does it help if you first  set

names(attributes(data)$variable.labels) <- names(data)

-- 
    O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907