-1

enter image description here

I have above table containing latitude and longitude values, But latitudes are in column & longitudes are in row, I want both in column wise and with their corresponding values

Máté Juhász
  • 2,197
  • 1
  • 19
  • 40
  • The action you're looking for is called unpivot. You can find plenty of tips already on the internet. – Máté Juhász Feb 03 '17 at 09:23
  • Useful pointers for you http://stackoverflow.com/questions/7980030/how-to-pivot-unpivot-cast-melt-data-frame, http://stackoverflow.com/questions/2185252/reshaping-data-frame-from-wide-to-long-format – Saurabh Chauhan Feb 03 '17 at 09:28

1 Answers1

0

Could you add the desired output? I guess you can use reshape package.

library(reshape)
df <- read.table("your_file")
result <- melt(df, id = c("name"))
Peter Chung
  • 109
  • 2
  • 10