Skip to content

Exporting results to R format produces wrong code #87

@xca1019

Description

@xca1019

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions