• Aucun résultat trouvé

Overview of the spnet package

N/A
N/A
Protected

Academic year: 2022

Partager "Overview of the spnet package"

Copied!
51
0
0

Texte intégral

(1)

Report

Reference

Overview of the spnet package

ROUSSEAUX, Emmanuel, DEVILLE, Marion, RITSCHARD, Gilbert

ROUSSEAUX, Emmanuel, DEVILLE, Marion, RITSCHARD, Gilbert. Overview of the spnet package . 2016

Available at:

http://archive-ouverte.unige.ch/unige:84162

Disclaimer: layout of this document may differ from the published version.

1 / 1

(2)

Séminaire de recherche en statistiques pour sciences sociales

May 8, 2014 - University of Geneva

The R spnet package

Plotting social networks on maps

Emmanuel Rousseaux and Marion Deville

Institute for Demographic and Life Course Studies University of Geneva

[email protected]

(3)

Outline

Introduction

Functionalities Applications Conclusion

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 1/49

(4)

Motivation

I Rendering social networks is an efficient way to interpret them

I Social networks may hold a spatial dimension

I Social networks may evolve over time

(5)

Goals

I Rendering social networks

I Rendering the spatial dimension

I Tracking network’s evolution over time

I Tracking spatial evolution over time

I Efficient in term of use

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 3/49

(6)

Design

I The graphical tool is released as a R package

I Map handling and rendering are based on the

’sp’ package

I Networks are squared matrix

(7)

Outline

Introduction Functionalities

Applications Conclusion

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 5/49

(8)

library (spnet)

mymap <- room.create.u (x = c (6, 3, 6), out = "matrix") mymap

## [,1] [,2] [,3] [,4] [,5]

## [1,] 0 -1 -1 -1 0

## [2,] 0 -1 -1 -1 0

## [3,] 0 -1 -1 -1 0

## [4,] 0 -1 -1 -1 0

## [5,] 0 -1 -1 -1 0

## [6,] 0 -1 -1 -1 0

## [7,] -1 0 0 0 -1

(9)

node <- c ("John", "Elsa", "Brian", "Kate") position <- c (2,4,6,8)

net1 <- spnet.create (

data.frame ( 'NODE' = node, 'POSITION' = position ) )

spnet.map (net1) <- room.create.u (x= c (6,3,6)) spnet.title (net1)$main <- "My network"

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 7/49

(10)

net1

## This is a valid 'SpatialNetwork' object.

## ## - Data: (first rows)

## ## NODE POSITION

## 1 John 2

## 2 Elsa 4

## 3 Brian 6

## 4 Kate 8

## ## - Map:

## Length: 15

(11)

plot(net1)

My network

John Elsa

Brian Kate

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 9/49

(12)

net1$parti <- c ('vert', 'socialiste', 'autre', 'vert') spnet.color (net1) <- list (

'variable' = 'parti',

'legend' = c ('vert' = "#32AB58", 'socialiste' = "#E31923")

)

(13)

net1

## This is a valid 'SpatialNetwork' object.

## ## - Data: (first rows)

## ## NODE POSITION parti

## 1 John 2 vert

## 2 Elsa 4 socialiste

## 3 Brian 6 autre

## 4 Kate 8 vert

## ## - Map:

## Length: 15

## ## - Plotting options:

## Variable used to colorize: 'parti'

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 11/49

(14)

plot(net1)

My network

John Elsa

Brian Kate

vert socialiste

(15)

net1$role <- c('Président', 'Chef de groupe', 'Porteur du projet', 'partisan') spnet.symbol (net1) <- list (

'variable' = 'role',

'legend' = c('Président' = 'square.rotated', 'Chef de groupe' = 'triangle.up', 'Porteur du projet' = 'circle'), 'cex' = 6,

'color' = 'blue' )

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 13/49

(16)

net1

## This is a valid 'SpatialNetwork' object.

## ## - Data: (first rows)

## ## NODE POSITION parti role

## 1 John 2 vert Président

## 2 Elsa 4 socialiste Chef de groupe

## 3 Brian 6 autre Porteur du projet

## 4 Kate 8 vert partisan

## ## - Map:

## Length: 15

## ## - Plotting options:

## Variable used to colorize: 'parti'

## Variable used to draw symbols: 'role'

(17)

plot(net1)

My network

John Elsa

Brian Kate

vert socialiste

Président Chef de groupe Porteur du projet

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 15/49

(18)

network1 <- matrix ( rep (0, length (node)^2), nrow = length (node), dimnames = list (node, node) ) network1['John', 'Elsa'] <- 1 network1['Kate', 'Brian'] <- 2 network1

## John Elsa Brian Kate

## John 0 1 0 0

## Elsa 0 0 0 0

## Brian 0 0 0 0

## Kate 0 0 2 0

(19)

spnet.networks(net1)$yes$matrix <- network1 net1

## This is a valid 'SpatialNetwork' object.

## ## - Data: (first rows)

## ## NODE POSITION parti role

## 1 John 2 vert Président

## 2 Elsa 4 socialiste Chef de groupe

## 3 Brian 6 autre Porteur du projet

## 4 Kate 8 vert partisan

## ## - Map:

## Length: 15

## ## - Network data:

## Number of network(s): 1

## ## - Plotting options:

## Variable used to colorize: 'parti'

## Variable used to draw symbols: 'role'

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 17/49

(20)

plot(net1)

My network

John Elsa

Brian Kate

vert socialiste

Président Chef de groupe Porteur du projet

yes

(21)

network2 <- matrix ( rep (0, length (node)^2), nrow = length(node), dimnames = list (node, node) ) network2['John', 'Elsa'] <- 1 network2['John', 'Brian'] <- 1 network2['Brian', 'Elsa'] <- 3 network2

## John Elsa Brian Kate

## John 0 1 1 0

## Elsa 0 0 0 0

## Brian 0 3 0 0

## Kate 0 0 0 0

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 19/49

(22)

spnet.networks(net1)$no$matrix <- network2 net1

## This is a valid 'SpatialNetwork' object.

## ## - Data: (first rows)

## ## NODE POSITION parti role

## 1 John 2 vert Président

## 2 Elsa 4 socialiste Chef de groupe

## 3 Brian 6 autre Porteur du projet

## 4 Kate 8 vert partisan

## ## - Map:

## Length: 15

## ## - Network data:

## Number of network(s): 2

## ## - Plotting options:

## Variable used to colorize: 'parti'

## Variable used to draw symbols: 'role'

(23)

plot(net1)

My network

John Elsa

Brian Kate

vert socialiste

Président Chef de groupe Porteur du projet

yes no

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 21/49

(24)

Outline

Introduction

Functionalities

Applications

Conclusion

(25)

Inflows/Outflows of migrants in Switzerland

I Data source: OCDE International migration database (website)

I Scope: worldwide

I Flows derived from population registers

I Year: 2000 to 2011

I World map: TM World Borders Simpl-0.3, by bjørn sandvik

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 23/49

(26)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2000

(27)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2001

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 25/49

(28)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2002

(29)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2003

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 27/49

(30)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2004

(31)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2005

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 29/49

(32)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2006

(33)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2007

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 31/49

(34)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2008

(35)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2009

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 33/49

(36)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2010

(37)

Figure : Inflows (blue) / Outflows (red) of migrants in Switzerland, 2011

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 35/49

(38)

Measuring the political Debate

I Data source: Assemblée constituante de Genève

I Networks of individual and collective references between parliamentarian during the debate

I Debate: Extension of political rights for foreigners

I Year: 2009 to 2012

I Map: Modelization of the Concil of Geneva

room, Rousseaux and Deville.

(39)

Individual references: Débat introductif

Buchi Bureau PresidenceAssemblee

GauthierZimmermann Mouhanna Politiciens Schifferli Scherb Muller

Rochat Bezaguet Grobet Peuple Experts Blasi Pagan Amaudruz

Turrian Zosso de Dardel Martenot Haller Dimier DelachauxEngelbert Benusiglio Pardo

Lyon Ducommun Zimmermann Extermann Barde de SaussureGenecand Demole Guinchard

Perregaux Baranzini Mizrahi Velasco Calame Eggly de MontmoulinHalperin HottelierKuffer−GallandBordier Chevrolet

Rodrik Lachat Gardiol Tanquerel Lador Saurer Savary Lebeau Gisiger President1 Kunz Zwahlen Luscher Weber Hirsch Koechlin Barbey

Ozden Manuel Kasser IrmingerContat HickelPerroux Sayegh Loretan Saudan Alder Roy Hentsch

Dufresne Bachmann Muller Sontag Tornare Follmi Terrier Chevieux Maurice

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 37/49

(40)

Individual references: Débat avant-projet

Buchi Bureau PresidenceAssemblee

GauthierZimmermann Mouhanna Politiciens Schifferli Scherb Muller

Rochat Bezaguet Grobet Peuple Experts Blasi Pagan Amaudruz

Turrian Zosso de Dardel Martenot Haller Dimier DelachauxEngelbert Benusiglio Pardo

Lyon Ducommun Zimmermann Extermann Barde de SaussureGenecand Demole Guinchard

Perregaux Baranzini Mizrahi Velasco Calame Eggly de MontmoulinHalperin HottelierKuffer−GallandBordier Chevrolet

Rodrik Lachat Gardiol Tanquerel Lador Saurer Savary Lebeau Gisiger President1 Kunz Zwahlen Luscher Weber Hirsch Koechlin Barbey

Ozden Manuel Kasser IrmingerContat HickelPerroux Sayegh Loretan Saudan Alder Roy Hentsch

Dufresne Bachmann Muller Sontag Tornare Follmi Terrier Chevieux Maurice

(41)

Individual references: Débat première lecture

Buchi Bureau PresidenceAssemblee

GauthierZimmermann Mouhanna Politiciens Schifferli Scherb Muller

Rochat Bezaguet Grobet Peuple Experts Blasi Pagan Amaudruz

Turrian Zosso de Dardel Martenot Haller Dimier DelachauxEngelbert Benusiglio Pardo

Lyon Ducommun Zimmermann Extermann Barde de SaussureGenecand Demole Guinchard

Perregaux Baranzini Mizrahi Velasco Calame Eggly de MontmoulinHalperin HottelierKuffer−GallandBordier Chevrolet

Rodrik Lachat Gardiol Tanquerel Lador Saurer Savary Lebeau Gisiger President1 Kunz Zwahlen Luscher Weber Hirsch Koechlin Barbey

Ozden Manuel Kasser IrmingerContat HickelPerroux Sayegh Loretan Saudan Alder Roy Hentsch

Dufresne Bachmann Muller Sontag Tornare Follmi Terrier Chevieux Maurice

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 39/49

(42)

Individual references: Débat seconde lecture

Buchi Bureau PresidenceAssemblee

GauthierZimmermann Mouhanna Politiciens Schifferli Scherb Muller

Rochat Bezaguet Grobet Peuple Experts Blasi Pagan Amaudruz

Turrian Zosso de Dardel Martenot Haller Dimier DelachauxEngelbert Benusiglio Pardo

Lyon Ducommun Zimmermann Extermann Barde de SaussureGenecand Demole Guinchard

Perregaux Baranzini Mizrahi Velasco Calame Eggly de MontmoulinHalperin HottelierKuffer−GallandBordier Chevrolet

Rodrik Lachat Gardiol Tanquerel Lador Saurer Savary Lebeau Gisiger President1 Kunz Zwahlen Luscher Weber Hirsch Koechlin Barbey

Ozden Manuel Kasser IrmingerContat HickelPerroux Sayegh Loretan Saudan Alder Roy Hentsch

Dufresne Bachmann Muller Sontag Tornare Follmi Terrier Chevieux Maurice

(43)

Individual references: Débat troisième lecture

Buchi Bureau PresidenceAssemblee

GauthierZimmermann Mouhanna Politiciens Schifferli Scherb Muller

Rochat Bezaguet Grobet Peuple Experts Blasi Pagan Amaudruz

Turrian Zosso de Dardel Martenot Haller Dimier DelachauxEngelbert Benusiglio Pardo

Lyon Ducommun Zimmermann Extermann Barde de SaussureGenecand Demole Guinchard

Perregaux Baranzini Mizrahi Velasco Calame Eggly de MontmoulinHalperin HottelierKuffer−GallandBordier Chevrolet

Rodrik Lachat Gardiol Tanquerel Lador Saurer Savary Lebeau Gisiger President1 Kunz Zwahlen Luscher Weber Hirsch Koechlin Barbey

Ozden Manuel Kasser IrmingerContat HickelPerroux Sayegh Loretan Saudan Alder Roy Hentsch

Dufresne Bachmann Muller Sontag Tornare Follmi Terrier Chevieux Maurice

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 41/49

(44)

Collective references: Débat introductif

No collective references

(45)

Collective references: Débat avant-projet

Extrême gauche Extrême droite

UDC SolidaritéS

AVIVO MCG

GEA

Socialistes Liberaux

Associations PLR

Verts

PDC

Radicaux

Gauche Droite

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 43/49

(46)

Collective references: Débat première lecture

Extrême gauche Extrême droite

UDC SolidaritéS

AVIVO MCG

GEA

Socialistes Liberaux

Associations PLR

Verts

PDC

Radicaux

Gauche Droite

(47)

Collective references: Débat seconde lecture

Extrême gauche Extrême droite

UDC SolidaritéS

AVIVO MCG

GEA

Socialistes Liberaux

Associations PLR

Verts

PDC

Radicaux

Gauche Droite

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 45/49

(48)

Collective references: Débat troisième lecture

Extrême gauche Extrême droite

UDC SolidaritéS

AVIVO MCG

GEA

Socialistes Liberaux

Associations PLR

Verts

PDC

Radicaux

Gauche Droite

(49)

Outline

Introduction Functionalities Applications Conclusion

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 47/49

(50)

Conclusion

I Efficient tool for rendering social networks on maps

I A lot of graphical settings

I Tools for preparing data

Outlook

I Filtering the social network (frequences, ...)

I Plot connections one-by-one

I Enhance comparaison of plots

(51)

Thank you for your attention!

Rousseaux and Deville – The R spnet package, plotting social networks on maps – 49/49

Références

Documents relatifs

Transpose takes as input parameters the table returned by the create.smooth function ( tab_smooth ), the input data table ( ecopath ), and the name of the column the user wants

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

marmap can query the ETOPO1 bathymetry and topography database hosted by the NOAA, use simple latitude-longitude-depth data in ascii format, and take advantage of the advanced

Objectif de Icarus (Icarus CAle et Redresse les Unités en Sondages) : proposer un package avec des fonctionnalités spéci�quement dédiées au calage, avec une interface proche

Figure 6 shows that the packages Re- moteDirectory and TelNetWordNet are referencing together the same set of packages within Network: both refer to classes into Kernel, Protocols

The ZIP employ two different process : a binary distribution that generate structural

Once the network is infered from the generated data, it can be compared to the true underlying network in order to validate the inference algorithm... This function takes the

The SOMbrero R package implements on-line algorithms of SOM for three types of data (numeric vectors, contingency tables and dissimilarity data), and provides multiple diagnostic