Skip to content

Commit

Permalink
Fix for mixed up longitude and latitude. Typo fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeBassTian23 committed Mar 24, 2017
1 parent c516392 commit 7af540e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: PhotosynQ
Title: Connect to PhotosynQ
Version: 0.0.6
Version: 0.0.7
Authors@R: person("Sebastian", "Kuhlgert", email = "sebastian.kuhlgert@gmail.com", role = c("aut", "cre"))
Description: This package helps to connect R to the PhotosynQ platform. It allows you to login and logout,
as well as receive project information and project data. More importantly it transforms the received
Expand Down
18 changes: 9 additions & 9 deletions R/createDataframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ createDataframe <- function(project_info="", project_data =""){
spreadsheet[[p]][["device_id"]] <- c(1)
spreadsheet[[p]][["status"]] <- c(1)
spreadsheet[[p]][["notes"]] <- c(1)
spreadsheet[[p]][["latitude"]] <- c(1)
spreadsheet[[p]][["longitude"]] <- c(1)
spreadsheet[[p]][["latitute"]] <- c(1)
}

for(measurement in project_data){
Expand Down Expand Up @@ -179,25 +179,25 @@ createDataframe <- function(project_info="", project_data =""){
next
}

if(param == "longitude"){
if(param == "latitude"){
if(is.null(measurement$location) || is.na(measurement$location)){
spreadsheet[[protocolID]][["longitude"]] <- c(spreadsheet[[protocolID]][["longitude"]], NA)
spreadsheet[[protocolID]][["latitude"]] <- c(spreadsheet[[protocolID]][["latitude"]], NA)
}
else{
spreadsheet[[protocolID]][["longitude"]] <- c(spreadsheet[[protocolID]][["longitude"]], as.numeric(measurement$location[[1]]))
spreadsheet[[protocolID]][["latitude"]] <- c(spreadsheet[[protocolID]][["latitude"]], as.numeric(measurement$location[[1]]))
}
next
}
}

if(param == "latitute"){
if(param == "longitude"){
if(is.null(measurement$location) || is.na(measurement$location)){
spreadsheet[[protocolID]][["latitute"]] <- c(spreadsheet[[protocolID]][["latitute"]], NA)
spreadsheet[[protocolID]][["longitude"]] <- c(spreadsheet[[protocolID]][["longitude"]], NA)
}
else{
spreadsheet[[protocolID]][["latitute"]] <- c(spreadsheet[[protocolID]][["latitute"]], as.numeric(measurement$location[[2]]))
spreadsheet[[protocolID]][["longitude"]] <- c(spreadsheet[[protocolID]][["longitude"]], as.numeric(measurement$location[[2]]))
}
next
}
}

if(param == "notes"){
spreadsheet[[protocolID]][["notes"]] <- c(spreadsheet[[protocolID]][["notes"]], toString(measurement$note))
Expand Down

0 comments on commit 7af540e

Please sign in to comment.