Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
spatialspecial [2019/04/15 16:56]
qcbs [Exercice 5]
spatialspecial [2019/04/15 16:58]
qcbs [Exercice 7]
Line 270: Line 270:
 To create a new R Processing script, click on the R logo on the top of the processing toolbox pane, and select Create New R Script. When you are done typing the script, give it an appropriate name and save it in the default folder that opens. ​ To create a new R Processing script, click on the R logo on the top of the processing toolbox pane, and select Create New R Script. When you are done typing the script, give it an appropriate name and save it in the default folder that opens. ​
 ===== Exercice 5 ===== ===== Exercice 5 =====
-Create a new R script in the toolbox. Copy and past this Processing/​R script that creates 100 points distributed randomly on the earth in the latitude/​longitude reference system (EPSG 4326) and that are imported as a QGIS layer. ​+Create a new R script in the toolbox ​by copying ​and pasting ​this Processing/​R script that creates 100 points distributed randomly on the earth in the latitude/​longitude reference system (EPSG 4326) and that are imported as a QGIS layer. ​
  
 Overlay the result on top of the TM_World_Borders shapefile. ​ Overlay the result on top of the TM_World_Borders shapefile. ​
Line 314: Line 314:
 #​data2=tapply(Layer$new_area,​Layer$IHO_Sea,​mean) #​data2=tapply(Layer$new_area,​Layer$IHO_Sea,​mean)
 library('​dplyr'​) library('​dplyr'​)
-library('​sf'​) 
 Layer=data.frame(Layer) Layer=data.frame(Layer)
 data2=Layer%>​%group_by(IHO_Sea)%>​%summarize(mean=mean(new_area)) data2=Layer%>​%group_by(IHO_Sea)%>​%summarize(mean=mean(new_area))