Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: cannot juxtapose string literal #404

Closed
azev77 opened this issue Feb 4, 2021 · 1 comment
Closed

syntax: cannot juxtapose string literal #404

azev77 opened this issue Feb 4, 2021 · 1 comment

Comments

@azev77
Copy link

azev77 commented Feb 4, 2021

The following works:

X = randn(100,5)
y = 7.0 .+ X[:,1] .+ 2.0 .* X[:,2] .* X[:,3] + 3*randn(100)

using RCall
@rput y
@rput X
R"
library(L0Learn)
J = ncol(X); nf = 5; set.seed(1); 
fitL0 = L0Learn.cvfit(X, y, nFolds=nf, seed=1, maxSuppSize=nrow(X)/2,
intercept = T)
"
@rget J
@rget fitL0

But I get an error when I include a kw w/ a string:

R"
library(L0Learn)
J = ncol(X); nf = 5; set.seed(1); 
fitL0 = L0Learn.cvfit(X, y, nFolds=nf, seed=1, maxSuppSize=nrow(X)/2,
intercept = T, algorithm = "CDPSI")
"

It says: syntax: cannot juxtapose string literal

@azev77
Copy link
Author

azev77 commented Feb 4, 2021

It can be solved w/ triple string quotations:

R"""
library(L0Learn)
J = ncol(X); nf = 5; set.seed(1); 
fitL0 = L0Learn.cvfit(X, y, nFolds=nf, seed=1, maxSuppSize=nrow(X)/2,
intercept = T, algorithm = "CDPSI")
"""

@palday palday closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants