Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

getLayer response to data.frame with only one feature? #4

Closed
tts opened this issue Dec 13, 2015 · 2 comments
Closed

getLayer response to data.frame with only one feature? #4

tts opened this issue Dec 13, 2015 · 2 comments

Comments

@tts
Copy link

tts commented Dec 13, 2015

I'm trying to process the response from fmi::observations::mareograph::timevaluepair query with only one parameter (watlev).

response <- client$getLayer(layer=layers[1], parameters=list(splitListFields=TRUE))

produces a 1-feature spatialPointsDataframe, so

dat <- as.data.frame(response)

gives me a dataframe in super-wide format: one observation with all time+value pairs are variables. I find this rather difficult to clean with e.g. tidyr.

Note that this might not be an issue, rather some kind of misunderstanding from my side.

P.S. Great package BTW!

@tts
Copy link
Author

tts commented Dec 29, 2015

Well, now that I had the time & patience, the response do was tidy-able with gather, extract and spread. Sorry about the false alarm.

@tts tts closed this as completed Dec 29, 2015
@jlehtoma
Copy link
Contributor

I had completely missed this, sorry! I remember to have been struggling with this as well, would probably make sense to do at least some tidying within the package already.

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

No branches or pull requests

2 participants