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

Exporting results to R format produces wrong code #87

Open
xca1019 opened this issue Apr 22, 2013 · 0 comments
Open

Exporting results to R format produces wrong code #87

xca1019 opened this issue Apr 22, 2013 · 0 comments
Labels

Comments

@xca1019
Copy link

xca1019 commented Apr 22, 2013

For our FIWARE experiments, the following R code is generated:

----- BEGIN -------------------------------------------------------------------------------------------------------
r0 <- c("application/json", 11.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
r1 <- c("application/json", 9.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
r2 <- c("application/json", 17.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
...
r6997 <- c("application/xml", 7.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
r6998 <- c("application/xml", 6.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
r6999 <- c("application/xml", 8.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
myframe <- data.frame(r0, r1, r2, ... r6997, r6998, r6999)
colnames(myframe) <- c("acceptHeader", "responseTime", "collection", "repositoryUrl")
----- END -------------------------------------------------------------------------------------------------------

The results is a data frame with 1 row and 28K columns. Instead it should be 7K rows and 4 columns.

I modified the code (which should be faster too) and propose to use that instead:

----- BEGIN -------------------------------------------------------------------------------------------------------
myframe <- data.frame( matrix( nrow = 7000, ncol = 4 ) )
myframe[1,] <- c("application/json", 11.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
myframe[2,] <- c("application/json", 9.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
myframe[3,] <- c("application/json", 17.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
...
myframe[6998,] <- c("application/xml", 7.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
myframe[6999,] <- c("application/xml", 6.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
myframe[7000,] <- c("application/xml", 8.0, "/testCollection", "http://10.55.149.20:8080/FiwareRepository/v1")
colnames(myframe) <- c("acceptHeader", "responseTime", "collection", "repositoryUrl")
----- END -------------------------------------------------------------------------------------------------------

Best Regards,
Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant