- Posts: 4466
- Thank you received: 1044
- Forum
- English support forums
- Can I do this with LimeSurvey?
- Using RemoteControl in R and reading data from limesurvey into R
Using RemoteControl in R and reading data from limesurvey into R
4 years 7 months ago #137530
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Using RemoteControl in R and reading data from limesurvey into R
The manual states > print(survey_matrix[1:2,])
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.
> 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
Please Log in to join the conversation.
- fransmarcelissen
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 204
- Thank you received: 55
4 years 7 months ago #137543
by fransmarcelissen
Replied by fransmarcelissen on topic Using RemoteControl in R and reading data from limesurvey into R
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
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
Please Log in to join the conversation.
4 years 2 months ago #143558
by kalimu
Replied by kalimu on topic Using RemoteControl in R and reading data from limesurvey into R
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
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
Please Log in to join the conversation.
- jorgesinval
-
- Offline
- New Member
-
- Psychometrician
Less
More
- Posts: 19
- Thank you received: 0
3 years 9 months ago #152543
by jorgesinval
Replied by jorgesinval on topic Using RemoteControl in R and reading data from limesurvey into R
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.
Thanks.
Please Log in to join the conversation.
2 years 11 months ago #163998
by first
Survey Designer and Programmer
Replied by first on topic Using RemoteControl in R and reading data from limesurvey into R
@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.
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
Please Log in to join the conversation.
2 years 11 months ago - 2 years 11 months ago #164008
by first
Survey Designer and Programmer
Replied by first on topic Using RemoteControl in R and reading data from limesurvey into R
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
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: 2 years 11 months ago by first.
Please Log in to join the conversation.
2 years 11 months ago #164018
by first
Survey Designer and Programmer
Replied by first on topic Using RemoteControl in R and reading data from limesurvey into R
More findings: Status code returned is 406 instead of 200. Any ideas...
Survey Designer and Programmer
Please Log in to join the conversation.
2 years 11 months ago #164033
by jelo
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
Replied by jelo on topic Using RemoteControl in R and reading data from limesurvey into R
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
Please Log in to join the conversation.
2 years 11 months ago #164042
by first
Survey Designer and Programmer
Replied by first on topic Using RemoteControl in R and reading data from limesurvey into R
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
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
Please Log in to join the conversation.
2 years 11 months ago #164055
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Using RemoteControl in R and reading data from limesurvey into R
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.
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
Please Log in to join the conversation.
2 years 11 months ago #164056
by first
Survey Designer and Programmer
Replied by first on topic Using RemoteControl in R and reading data from limesurvey into R
Disabling modsecurity at domain level worked well but white listing IP didnt . Do you suggest disabling modsecurity? Any other thoughts?
Survey Designer and Programmer
Please Log in to join the conversation.
2 years 11 months ago #164078
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Using RemoteControl in R and reading data from limesurvey into R
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
Please Log in to join the conversation.
1 year 3 months ago - 1 year 3 months ago #189868
by zufolo441
Replied by zufolo441 on topic Using RemoteControl in R and reading data from limesurvey into R
Hi,
I'm trying to use this library, but get_responses puts all columns values in one, separed by commas, and all column titles in one, separed by dots.
I'm using last version downloaded by github, LimeSurvey 2.6.4-lts Build 170202 and R version 3.6.1 (2019-07-05)
this is the script:
library("limer")
options (lime_api = 'https://questionari.istitutodeglinnocenti.it/index.php/admin/remotecontrol')
options(lime_username = 'XXXX')
options(lime_password = 'XXXX')
get_session_key()
data <- get_responses(iSurveyID=XXXX, sLanguageCode= 'it', sResponseType='long')
release_session_key()
thanks!
I'm trying to use this library, but get_responses puts all columns values in one, separed by commas, and all column titles in one, separed by dots.
I'm using last version downloaded by github, LimeSurvey 2.6.4-lts Build 170202 and R version 3.6.1 (2019-07-05)
this is the script:
library("limer")
options (lime_api = 'https://questionari.istitutodeglinnocenti.it/index.php/admin/remotecontrol')
options(lime_username = 'XXXX')
options(lime_password = 'XXXX')
get_session_key()
data <- get_responses(iSurveyID=XXXX, sLanguageCode= 'it', sResponseType='long')
release_session_key()
thanks!
Last edit: 1 year 3 months ago by zufolo441.
Please Log in to join the conversation.
1 year 2 months ago #191276
by zufolo441
Replied by zufolo441 on topic Using RemoteControl in R and reading data from limesurvey into R
I found the problem:
in base64_to_df
I had to replace
return(read.csv(textConnection(raw_csv), stringsAsFactors = FALSE, sep = ";"))
with
return(read.csv(textConnection(raw_csv), stringsAsFactors = FALSE, sep = ","))
in base64_to_df
I had to replace
return(read.csv(textConnection(raw_csv), stringsAsFactors = FALSE, sep = ";"))
with
return(read.csv(textConnection(raw_csv), stringsAsFactors = FALSE, sep = ","))
Please Log in to join the conversation.
- jorgesinval
-
- Offline
- New Member
-
- Psychometrician
Less
More
- Posts: 19
- Thank you received: 0
11 months 3 weeks ago #192961
by jorgesinval
Replied by jorgesinval on topic Using RemoteControl in R and reading data from limesurvey into R
I'm facing the same problem. Did you solve the problem?
Please Log in to join the conversation.