Export data from Google Analytics API with rga in R


Let’s assume that the google api link start like this:
And now I need to export data from, but for the code below I got errors:

ga$getData(29A5366921, batch = TRUE, '2017-12-01', '2017-12-10', 
           metrics = "ga:visits", dimensions = "ga:date", 
           sort = "", filters = "", segment = "",
           start = 1, max = 1000)

One of the errors (others are pretty much the same, just for different parameter): unexpected ',' in " start = 1,"
I don’t have ‘,’ anywhere between ”, commas are here just to separate the parameters, but this is the first time in my life I trying to use R and maybe there is some hidden rule.

Not sure what to type at the beginning of the code, instead ga$getData did I need to type 29A5366921$getData?

I’m using rga library.

Any help is welcomed. Thanks in advance.


Did you try making it all single line? or try adding + at the end of every line.
@amrrs I have made it in single line, but now error is : Error in if (sort != “”) { : argument is of length zero . And when I change that with NULL, I got next Error: unexpected symbol in “ga$getData(29A5366921”
– jovicbg
3 hours ago