R: use shorter and cooler names for functions #553

Closed
gaborcsardi opened this Issue Dec 12, 2013 · 5 comments

Projects

None yet

2 participants

@gaborcsardi
Member

E.g. 'ring' instead of graph.ring, etc. We would keep the older names as well, to stay compatible with older code.

The G_ prefix can be added to functions that create graphs,
L_ for functions that create layouts, C_ for clustering and
community finding functions. Maybe.

Should we have prefix for node indices, and graph indices? Maybe not.
For centrality scores? Maybe not.

Here is a list, to be completed.

  • graph.ringG_ring
  • add.edges is good, we can use +, or add_edges (network clash)
  • add.vertex.shapeadd_shape
  • add.vertices is good, we can use +, or add_vertices (network_clash)
  • adjacent.trianglescount_triangles (not num_triangles)
  • adjcorr will be removed probably
  • aging.ba.gameG_pa_age
  • aging.barabasi.gameG_pa_age
  • aging.prefatt.gameG_pa_age
  • alpha.centralityalpha_centrality
  • are.connectedis_connected_to
  • arpack is OK
  • arpack.unpack.complex should be internal
  • articulation.pointsarticulation_points
  • as.directed is OK
  • as.igraph is OK
  • as.undirected is OK
  • asPhyloas_phylo
  • assortativity is OK, or assort
  • assortativity.degreeassort_deg
  • assortativity.nominalassort_nom
  • asymmetric.preference.gameG_pref_asym
  • authority.scoreauthority ?
  • autocurve.edgesmake_curves
  • average.path.lengthmean_distance
  • ba.gameG_pa
  • barabasi.gameG_pa
  • betweennessbetw to avoid name clashes with sna, maybe betw_centrality as well
  • betweenness.estimate can be merged into betweenness
  • bibcoupling is OK, or bib_coupling
  • biconnected.componentsbiconn_comps
  • bipartite.mappingbip_map
  • bipartite.projectionbip_proj
  • bipartite.projection.sizebip_proj_size
  • bipartite.random.gameG_np_bip
  • blockGraphsG_blocks
  • blocks is OK
  • bonpowpower_centrality
  • callaway.traits.gameG_traits_callaway
  • canonical.permutationcanon_perm
  • centralization.betweennesscentr_betw
  • centralization.betweenness.tmaxcentr_betw_max
  • centralization.closenesscentr_clo
  • centralization.closeness.tmaxcentr_clo_max
  • centralization.degreecentr_deg
  • centralization.degree.tmaxcentr_deg_max
  • centralization.evcentcentr_eigen
  • centralization.evcent.tmaxcentr_eigen_max
  • centralize.scorescentralize
  • cited.type.gameG_cit_types
  • citing.cited.type.gameG_cit_types
  • clique.numberclique_num
  • cliques is OK
  • closenessclo should be renamed to avoid clash with sna, also clo_centr for consistency
  • closeness.estimate could be incorporates in clo
  • cluster.distributioncomp_dist
  • clusters is OK, or comps
  • cocitation is OK
  • code.lengthcode_len
  • cohesion is OK
  • cohesive.blockscohesive_blocks
  • communities is OK
  • community.le.to.membership will be removed I believe
  • community.to.membership will be also removed AFAIR
  • compare is OK
  • compare.communitiescompare
  • connect.neighborhoodconnect
  • constraint is OK
  • contract.verticescontract
  • convex.hullconvex_hull
  • count.multiplecount_multiple
  • crossing is OK
  • cutatcut_at
  • decompose.graphdecompose
  • degreedeg to avoid sna clash, maybe also deg_centr for consistency
  • degree.distributiondeg_dist
  • degree.sequence.gameG_degseq
  • delete.edgesdelete_edges (network clash)
  • delete.verticesdelete_vertices (network clash)
  • dendPlotdend_plot
  • diameter is OK
  • dominator.treedominator_tree
  • dyad.censusdyad_census to avoid sna name clash
  • E is OK
  • E<- is OK
  • eccentricity is OK
  • ecount is OK, although is should be size according to graph theory
  • edge is OK
  • edge.attributesedge_attr
  • edge.attributes<-edge_attr<-
  • edge.betweenness edge_betw
  • edge.betweenness.community cs_edge_betw
  • edge.betweenness.community.merges should be internal?
  • edge.betweenness.estimate should be merged into edge_betw
  • edge.connectivity edge_conn
  • edge.disjoint.paths edge_disjoint_paths
  • edges is OK
  • erdos.renyi.gameG_np and g_nm
  • establishment.gameG_traits
  • evcenteigen_centr to avoid sna name clashes
  • evolver.d should be removed
  • exportPajek should be a seperate format
  • farthest.nodesfarthest_vertices
  • fastgreedy.communitycs_fast_greedy
  • forest.fire.gameG_forestfire
  • get.adjacencyadj or as.matrix or and as() conversion
  • get.adjedgelistadj_edge_list
  • get.adjlistadj_list
  • get.all.shortest.pathsshortest_paths
  • get.data.frameas.data.frame ?
  • get.diameter might be built into diameter
  • get.edgeends, should be merged with get.edges
  • get.edge.attributeedge_attr (network clash)
  • get.edge.idsfind_edges ?
  • get.edgelistedgelist
  • get.edgesends (network clash)
  • get.graph.attributegraph_attr
  • get.incidenceincidence
  • get.shortest.paths shortest_paths
  • get.stochastic stochastic
  • get.vertex.attributevertex_attr (network clash)
  • getIgraphOptigraph_option ?
  • girth is OK
  • graphG #521
  • graph.adhesionadhesion
  • graph.adjacencyG_adj_matrix
  • graph.adjlistG_adj_list
  • graph.atlasG_atlas
  • graph.attributes graph_attr
  • graph.attributes<- graph_attr<-
  • graph.automorphismsautomorphisms
  • graph.bfsbfs
  • graph.bipartiteG_bip
  • graph.cohesioncohesion
  • graph.complementercomplementer
  • graph.composecompose
  • graph.corenesscoreness
  • graph.count.isomorphisms.vf2count_iso
  • graph.count.subisomorphisms.vf2count_sub_iso
  • graph.data.frameG_df
  • graph.de.bruijnG_de_bruijn
  • graph.densitydensity clashes with stats package
  • graph.dfsdfs
  • graph.differencedifference
  • graph.disjoint.uniondisjoint_union
  • graph.diversitydiversity
  • graph.edgelistG_edgelist
  • graph.eigenadj_eigen
  • graph.emptyG_empty
  • graph.extended.chordal.ringG_chordal_ring
  • graph.famousg_famous
  • graph.formulag_formula
  • graph.fullG_full
  • graph.full.bipartiteG_full_bip
  • graph.full.citationG_full_citation
  • graph.get.isomorphisms.vf2get_iso
  • graph.get.subisomorphisms.vf2get_sub_iso
  • graph.graphdbG_graphdb
  • graph.incidenceG_incidence
  • graph.intersectionintersect clashes with a base package, so maybe intersection
  • graph.isoclassiso_class
  • graph.isoclass.subgraph might be build into iso_class
  • graph.isocreateG_iso_class
  • graph.isomorphicisomorphic
  • graph.isomorphic.34 should be added to isomorphic
  • graph.isomorphic.bliss should be added to isomorphic
  • graph.isomorphic.vf2 should be added to isomorphic
  • graph.kautzG_kautz
  • graph.knnknn
  • graph.laplacianlaplacian
  • graph.latticeG_lattice
  • graph.lcfG_lcf
  • graph.maxflowmax_flow
  • graph.mincutmin_cut
  • graph.motifsmotifs
  • graph.motifs.estsample_motifs
  • graph.motifs.nonum_motifs
  • graph.neighborhoodG_ego
  • graph.ringG_ring
  • graph.starG_star
  • graph.strengthstrength
  • graph.subisomorphic.lad add to sub_isomorphic
  • graph.subisomorphic.vf2 add to sub_isomorphic
  • graph.treeG_tree
  • graph.unionunion
  • graphlets is OK
  • graphlets.candidate.basisgraphlet_basis
  • graphlets.projectgraphlet_proj
  • grg.gameG_geo or G_grg
  • growing.random.gameG_growing
  • has.multipleany_multiple
  • hierarchy is OK
  • hrg.consensushrg_consensus
  • hrg.createhrg
  • hrg.dendrogramG_hrg
  • hrg.gameG_hier or G_hrg
  • hrg.fithrg_fit
  • hrg.predict hrg_predict or just a method of predict
  • hub.scorehub_centr
  • igraph.arpack.default arpack_defaults
  • igraph.consoleconsole
  • igraph.drl.coarsendrl_defaults
  • igraph.drl.coarsestdrl_defaults
  • igraph.drl.defaultdrl_defaults
  • igraph.drl.finaldrl_defaults
  • igraph.drl.refinedrl_defaults
  • igraph.eigen.defaulteigen_defaults
  • igraph.from.graphNELG_graphnel ?
  • igraph.optionsigraph_options should be (almost) the same as igraph_option
  • igraph.par is deprecated, right?
  • igraph.samplesample_seq
  • igraph.shape.noclipshape_noclip
  • igraph.shape.noplotshape_noplot
  • igraph.to.graphNELto_graphnel
  • igraph.versionigraph_version
  • igraphdemoigraph_demo
  • igraphtestigraph_test
  • incident is OK
  • independence.numberivs_size
  • independent.vertex.setsivs
  • induced.subgraphinduced_subgraph
  • infomap.communitycs_infomap
  • interconnected.islands.gameG_islands
  • is.bipartiteis_bipartite or is_bip, clashes with network
  • is.chordalis_chordal
  • is.connectedis_connected should be renamed to avoid sna name clash
  • is.dagis_dag
  • is.degree.sequenceis_degseq
  • is.directedis_directed clashes with network
  • is.graphical.degree.sequence merge into is.degree.sequence
  • is.hierarchical is_hierarchical
  • is.igraph is OK
  • is.loopwhich_loop
  • is.matchingis_matching
  • is.maximal.matchingis_max_matching
  • is.minimal.separatoris_max_sep
  • is.multiplewhich_multiple
  • is.mutualwhich_mutual
  • is.namedis_named
  • is.separatoris_sep
  • is.simpleis_simple
  • is.weightedis_weighted
  • k.regular.gameG_k_reg
  • label.propagation.community cs_label_prop
  • largest.cliqueslargest_cliques
  • largest.independent.vertex.setslargest_ivs
  • lastcit.gameG_last_cit
  • layout.autoL_auto
  • layout.bipartiteL_bip
  • layout.circleL_circle
  • layout.drlL_drl
  • layout.fruchterman.reingoldL_fr
  • layout.graphoptL_graphopt
  • layout.gridL_grid
  • layout.grid.3dL_grid
  • layout.kamada.kawaiL_kk
  • layout.lglL_lgl
  • layout.mdsL_mds
  • layout.mergeL_merge
  • layout.normL_norm
  • layout.randomL_random
  • layout.reingold.tilfordL_tree
  • layout.sphereL_sphere
  • layout.springL_spring
  • layout.starL_star
  • layout.sugiyamaL_sugiyama
  • leading.eigenvector.community cs_leading_eigen
  • line.graphG_line
  • list.edge.attributesedge_attr_names
  • list.graph.attributesgraph_attr_names
  • list.vertex.attributesvertex_attr_names
  • maxcohesionmax_cohesion
  • maximal.cliquesmax_cliques
  • maximal.cliques.countnum_max_cliques
  • maximal.independent.vertex.setsmax_ivs
  • maximum.bipartite.matchingmax_bip_match
  • maximum.cardinality.searchmax_card
  • membership is OK
  • merges is OK
  • minimal.st.separatorsmin_st_sep
  • minimum.size.separatorsmin_size_sep
  • minimum.spanning.treemst
  • mod.matrixmodularity_matrix
  • modularity is OK
  • multilevel.communitycs_multilevel
  • neighborhoodego
  • neighborhood.sizeego_size
  • neighbors is OK
  • nexus.getnexus_get
  • nexus.infonexus_info
  • nexus.listnexus_list
  • nexus.searchnexus_search
  • no.clustersnum_comps
  • optimal.communitycs_optimal
  • page.rankpage_rank
  • page.rank.oldpage_rank_old, should be removed
  • parent is OK
  • path is OK
  • path.length.histdistance_table
  • permute.verticespermute
  • piecewise.layoutpiecewise
  • plot.communities is OK
  • plot.igraph is OK
  • plotHierarchyplot_hier
  • power.law.fitpl_fit
  • preference.gameG_pref
  • print.igraph is OK
  • print.igraph.es is OK
  • print.igraph.vs is OK
  • radius is OK
  • random.graph.gameG_np and G_nm
  • read.graphread_graph
  • reciprocity is OK
  • remove.edge.attributedelete_edge_attr
  • remove.graph.attributedelete_graph_attr
  • remove.vertex.attributedelete_vertex_attr
  • rewire is OK
  • rewire.edges should be build into rewire
  • rglplot is OK
  • running.meanrunning_mean
  • sbm.gameG_sbm
  • scg is OK
  • scgGroupingscg_group
  • scgNormEps scg_eps
  • scgSemiProjectors scg_semi_proj
  • set.edge.attributeset_edge_attr
  • set.graph.attributeset_graph_attr
  • set.vertex.attributeset_vertex_attr
  • sgm is OK
  • shortest.pathsdistances
  • showtraceshow_trace
  • similarity.dicesim_dice or similarity
  • similarity.invlogweightedsim_invlogw or similarity
  • similarity.jaccardsim_jaccard or similarity
  • simplify is OK
  • sizes is OK
  • spinglass.communitycs_spinglass
  • static.fitness.gameG_fitness
  • static.power.law.gameG_power_law
  • stCutsst_cuts
  • stMincutsst_min_cuts
  • str.igraph is OK
  • subcomponent is OK
  • subgraph is OK, but should do subgraph.edges
  • subgraph.centralitysubgraph_centrality
  • subgraph.edges should be renamed to subgraph
  • summary.igraph is OK
  • tkigraphtk_igraph
  • tkplottk_plot
  • tkplot.canvastk_convas
  • tkplot.centertk_center
  • tkplot.closetk_close
  • tkplot.export.postscripttk_postscript
  • tkplot.fit.to.screentk_fit
  • tkplot.getcoordstk_coords
  • tkplot.offtk_off
  • tkplot.reshapetk_reshape
  • tkplot.rotatetk_rotate
  • tkplot.setcoordstk_setcoords
  • topological.sorttopo_sort
  • transitivity is OK
  • triad.censustriad_census (name clash with sna)
  • unfold.treeunfold_tree
  • V is OK
  • V<- is OK
  • vcount → is OK, maybe, it should be order, according to graph theory
  • vertex is OK
  • vertex.attributesvertex_attr
  • vertex.attributes<-vertex_attr<-
  • vertex.connectivityvertex_conn
  • vertex.disjoint.pathsvertex_disjoint_paths
  • vertex.shapesshapes
  • vertices is OK
  • walktrap.communitycs_walktrap
  • watts.strogatz.gameG_smallworld
  • write.graphwrite_graph
@gaborcsardi gaborcsardi was assigned Dec 12, 2013
@pypingou

changing for the sake of changing doesn't seem like a very good idea, imho.

@gaborcsardi
Member

This is not decided yet, more of an experiment.

The goal is to have more descriptive, readable, logical, but possibly shorter names. E.g. ring or ring_graph instead of graph.ring, Gnp and Gnm instead of erdos.renyi.game. Maybe start community finding functions with a cs_ prefix, etc.

Initially R packages did not have namespaces, and for a long time, it was not compulsory, so I chose names that are longer and unique. Also underscore was not allowed, and then allowed, but discouraged in function names, and dot was suggested as name separator, which is less readable imo.

We would keep all old names as well, so no problem with compatibility.

@gaborcsardi
Member

Maybe first only rename graph constructors, and/or layout generators, because those are the names that suck most.

@gaborcsardi
Member

Work in the r-renaming branch: https://github.com/igraph/igraph/tree/r-renaming

This was referenced Sep 25, 2014
@gaborcsardi gaborcsardi added this to the 0.8 milestone Sep 28, 2014
@gaborcsardi gaborcsardi added a commit that referenced this issue Sep 28, 2014
@gaborcsardi gaborcsardi More renaming, #553 2e2ec2c
@gaborcsardi gaborcsardi added a commit that referenced this issue Sep 30, 2014
@gaborcsardi gaborcsardi More renaming, #553 8c3c67e
@gaborcsardi gaborcsardi added a commit that referenced this issue Oct 1, 2014
@gaborcsardi gaborcsardi More renaming, #553 cbd5dec
@gaborcsardi gaborcsardi referenced this issue Oct 1, 2014
Closed

R: rename centrality related functions #691

30 of 30 tasks complete
@gaborcsardi
Member

Mostly done. Opened separate issues for the remaining ones.

@gaborcsardi gaborcsardi closed this Oct 1, 2014
@gaborcsardi gaborcsardi added a commit that referenced this issue Oct 1, 2014
@gaborcsardi gaborcsardi Finish renaming, #553 df080f9
@gaborcsardi gaborcsardi added a commit that referenced this issue Oct 2, 2014
@gaborcsardi gaborcsardi R: more renaming, #553 2053456
@gaborcsardi gaborcsardi added a commit that referenced this issue Oct 2, 2014
@gaborcsardi gaborcsardi R: more renaming, #553 434fad1
@gaborcsardi gaborcsardi added a commit that referenced this issue Oct 7, 2014
@gaborcsardi gaborcsardi R: rename most functions for a better API, #553
Squashed commit of the following:

commit 4494e39
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Tue Oct 7 12:54:39 2014 -0400

    R: fix building by tuning the collation order of files

commit cc9884e
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Tue Oct 7 10:37:32 2014 -0400

    R: add gorder (vcount) and gsize (ecount), #698

commit f5fd820
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Fri Oct 3 00:07:47 2014 -0400

    R: nexus function have underscore instead of dot now, #709

commit 488fc13
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 23:12:26 2014 -0400

    Remove (r)evolver stuff, #702

commit 70fdd7b
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 23:07:40 2014 -0400

    R: put DRL layout options in one object, #701

commit fe6401a
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 23:00:00 2014 -0400

    R: HRG API brush up, #700

commit b212254
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 22:43:39 2014 -0400

    R: slightly better attribute api, #699

    graph_attr, vertex_attr, edge_attr, can now query and set all attributes,
    even for a subset of vertices or edges.

commit 53805b2
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 19:52:12 2014 -0400

    R: fix more renaming bugs

commit 6871dd4
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 17:20:31 2014 -0400

    R: some renaming fixes

commit 434fad1
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 17:05:36 2014 -0400

    R: more renaming, #553

commit 2053456
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Thu Oct 2 16:13:40 2014 -0400

    R: more renaming, #553

commit e36d5c4
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 23:17:13 2014 -0400

    Rename get.data.frame to data_frame, #697

commit 713eb37
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 23:13:35 2014 -0400

    Rename as.* and is.* functions, #697

commit 87b9af2
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 20:50:46 2014 -0400

    R: make arpack.unpack.complex internal #696

commit ad7a64d
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 20:47:25 2014 -0400

    R: remove edge.betweenness.community.merges, #695

commit bbb734c
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 19:39:10 2014 -0400

    R: remove community.le.to.membership, #693

    It was defunct, anyway. The same functionality will be
    eventually added to cut_at.

commit 78a6596
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 19:02:47 2014 -0400

    R: fix some renaming typos

commit df080f9
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 14:00:31 2014 -0400

    Finish renaming, #553

commit 021f252
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 12:48:49 2014 -0400

    R: rename community structure functions, #692

commit f114cb5
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 11:26:10 2014 -0400

    R: renamed more centrality related functions #691

commit b80e0cf
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 10:49:42 2014 -0400

    R: renaming some centrality related functions #691

commit 0fc9b74
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Wed Oct 1 10:02:54 2014 -0400

    R: rename remaining constructors #553 #686

commit cbd5dec
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Tue Sep 30 16:41:14 2014 -0400

    More renaming, #553

commit 2e2ec2c
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Sun Sep 28 00:44:58 2014 -0400

    More renaming, #553

commit f8d8ef5
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Sat Sep 27 16:12:38 2014 -0400

    R: rename layout functions, #688

commit a94c8f2
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Fri Sep 26 23:59:44 2014 -0400

    Renaming most constructors, #686

commit 4cbe223
Author: Gabor Csardi <csardi.gabor@gmail.com>
Date:   Fri Sep 26 15:48:24 2014 -0400

    R: graph.ring -> g_ring
0c4869a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment