cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 36 forks source link

list_participants returns a data.frame with a column that is a data.frame #9

Closed andrewheiss closed 7 years ago

andrewheiss commented 8 years ago

Received via e-mail:


Is this intended behaviour?

> req2 <- call_limer("list_participants", list(971744))
> names(req2)
[1] "tid"              "token"            "participant_info"
> get_session_key(password=LSPASSWORD,username = LSUSER)
[1] "xwi3uhr5kf4wapmv255i8k8s5gkcvhgr"
> req2 <- call_limer("list_participants", list(971744))
> names(req2)
[1] "tid"              "token"            "participant_info"
> class(req2$participant_info)
[1] "data.frame"
> names(req2$participant_info)
[1] "firstname" "lastname"  "email"

So list_participants returns a dataframe of 3 columns, one of which is a dataframe on itself.

jsibley2 commented 8 years ago

As mentioned in another issue, get_participants seems not to be working.

Using call_limer seems to work, but how do we ask for attributes to be included in the results?

Thanks!

tammoterhark commented 7 years ago

@jsibley2 : did you manage to find out? I am facing the same thing... Would love to get some direction.

Jan-E commented 7 years ago

So list_participants returns a dataframe of 3 columns, one of which is a dataframe on itself.

This is intended behaviour by the designers of LS: https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/remotecontrol/remotecontrol_handle.php#L1854

Jan-E commented 7 years ago

... how do we ask for attributes to be included in the results?

That is another issue.

participants<-get_participants(693329,iStart=0,iLimit=1007,bUnused=TRUE,aAttributes=c('attribute_1','attribute_2')) is the way to do that.

andrewheiss commented 7 years ago

Closing this since it reflects the API's expected behavior (and it's clearer now thanks to #14)