Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Using RemoteControl in R and reading data from limesurvey into R

More
7 years 9 months ago #137530 by jelo
The manual states > print(survey_matrix[1:2,])
Code:
> print(survey_matrix[1:2,])
Error in survey_matrix[1:2, ] : subscript out of bounds

When using print(survey_matrix[1:2]) without the comma the result looks correct?
Not sure if that should be changed in the manual.
R 3.3 was used. Still a greenhorn in R.

Access via https is possible. Seems to be an issue with mod security. Or it is a temporary issue.
Still wonder why a user was able to access via C# when the issue seems to be server-side.
Will have to ask for the C# code to see if that is possible.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 9 months ago #137543 by fransmarcelissen
Sorry: it should be as follows:
survey_matrix<-call_limer(method='list_surveys')
print(survey_matrix[1:2,])

the object that call_limer generates should of course have the same name as the object that is printed.
But above is confusing: the object is a dataframe, not a matrix. So better is:

survey_dataframe<-call_limer(method='list_surveys')
print(survey_dataframe[1:2,])

[1:2,] means: the first two rows. If you want to print the whole list: leave this away.
I updated this in the manual.
Frans
The topic has been locked.
More
7 years 4 months ago #143558 by kalimu
At the European R User Meeting in Poland early version of the new R package was presented – LimeRick.
LimeRick is a bridge between R and LimeSurvey and it is under active development. You can access the code of the package on public repo:
github.com/kalimu/LimeRick
There are some experimental features so they can be changed in the future.

The presentation from the conference is here:
rpubs.com/kalimu/erum

Feel free to contact me (e.g. via the homepage contact form) if you have any suggestions, comments, feedback, etc.

Hopefully you will find the package useful.
Best,
Kamil Wais
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
6 years 11 months ago #152543 by jorgesinval
Based on your experience, which is better? Use LimeSurvey to generate reports to each respondent, or import the data generate the reports with R, and use R to send the reports (e.g. mailR)?

Thanks.

Sinval
The topic has been locked.
More
6 years 1 month ago #163998 by first
@jelo : I am also facing same issue.

First it asked me to install package xml2 and then I am getting error: Error: Argument 'txt' must be a JSON string, URL or file



Were you able to sort it out?

Note :
1) I am also using LS206lts over HTTPS
2) I am having no problem working with same interface via nodejs.

Survey Designer and Programmer
The topic has been locked.
More
6 years 1 month ago - 6 years 1 month ago #164008 by first
Also please note that I have one more installation of ls206 lts (without https) and limer is working fine with it.

Maybe a discussion here will help R experts to understand issue better.

groups.google.com/a/spaziodati.eu/forum/...andelion/j2TowLs_5gY

Survey Designer and Programmer
Last edit: 6 years 1 month ago by first.
The topic has been locked.
More
6 years 1 month ago #164018 by first
More findings: Status code returned is 406 instead of 200. Any ideas...

Survey Designer and Programmer
The topic has been locked.
More
6 years 1 month ago #164033 by jelo

first wrote: I have one more installation of ls206 lts (without https) and limer is working fine with it.


You use the same R script (only destination server different) for both LS installations?
The connection on the working LS installation is established via http and NOT via https.
The connection on the NON-working LS installation is established via https only?
Are both installations on the same server? If no, what differences are between these?
What R / OS environment is used on the client side?

The source of this issue can be a mod security rule issue. That could be triggered by many things.

I would check without https first. Change credentials afterwards. If http is working, you have an issue with the TLS encryption. Which can be a server or client side issue.
If http is not working, it might be a Modsecurity rule, which is preventing the Remotecontrol-API traffic.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
6 years 1 month ago #164042 by first
jelo: You use the same R script ...
Triven: Yes, you are right.

jelo: The connection on the working ...
Triven: LS 2.06 is installed on two servers - server1 and server2
server1 : HTTPS | able to connect from google cloud via remote API | not able to connected from R installalled on local computer (response code 406)
server2 : HTTP | able to connect from google cloud | able to connected from R

Survey Designer and Programmer
The topic has been locked.
More
6 years 1 month ago #164055 by jelo
What R / OS environment is used on the client side?
I would try to connect from local computer to server1 with http first. Change credentials afterwards. If http is working, you have an issue with the TLS encryption. Which can be a server or client side issue.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
6 years 1 month ago #164056 by first
Disabling modsecurity at domain level worked well but white listing IP didnt . Do you suggest disabling modsecurity? Any other thoughts?

Survey Designer and Programmer
The topic has been locked.
More
6 years 1 month ago #164078 by jelo
So, you already narrowed the issue down to mod-security? If that is the case, you should consult your administrator/hoster etc. If a mod-security rule is the issue, you can disable that rule per domain, per URL etc. You don't need to disable ModSecurity completely. But server administration is not part of this forum.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose