I want to read the following file with and extract the longitude and latitude for certain areas. The file is satellite data from topex and contains the monthly wave energy fluxes around the worlds oceans.
For doing that i have the following loop that reads the specific data. I then want to create a worldmap/the specific region for example the baltic sea or whatever, that shows the the wave energy. Also i want to plot the averages and the trend for the wave energy and eventually calcualte a slope for the wave energy over time. I got the following loop library(sp) library(maptools) library(maps) library(rgdal) library(shape) library(mapdata) # "pow_sat_file.txt" inputpath1<-"/Users/Sam/Desktop/MER/rem/" inputfile1<-paste(inputpath1,"pow_sat_file.txt",sep="") sat<-read.table("pow_sat_file.txt",header=TRUE, sep="",nrow=-1) sat.mat<-as.data.frame(sat) dims<-dim(sat.mat) tempo<-matrix(0, nrow=dims[1], ncol=dims[2]) tempo<-data.frame(tempo) date<-seq(as.Date("1993/1/1"), as.Date("2005/10/1"), by="month") # France coordinates long.min<--6 long.max<-10 lat.min<-40 lat.max<-52 #Loop on "pow_sat_file.txt" to only keep the interesting points for (i in 1:dims[1]){ long<-sat.mat[i,1] lat<-sat.mat[i,2] if (((long>=-6 && long<=10)==TRUE ) && ((lat>=40 && lat<=52))==TRUE){ tempo[i,1]<-long tempo[i,2]<-lat for (j in 3:dims[2]){ tempo[i,j]<-sat.mat[i,j] } } } How do i continue from here to get a map of the specific region and a slope? Thx in advance -- View this message in context: http://r.789695.n4.nabble.com/Plotting-Satellite-tp4687971.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.