@@ -181,6 +181,49 @@ geoflow_contact <- R6Class("geoflow_contact",
181
181
# '@param country contact country
182
182
setCountry = function (country ){
183
183
self $ country <- country
184
+ },
185
+
186
+
187
+ # '@description Methods to export the \link{geoflow_contact} as \code{data.frame} using key-based syntax.
188
+ # '@param line_separator a line separator. By default, the default line separator will be used.
189
+ # '@return an object of class \code{data.frame} giving the entities using key-based syntax
190
+ asDataFrame = function (line_separator = NULL ){
191
+ if (is.null(line_separator )) line_separator <- get_line_separator()
192
+ out <- data.frame (
193
+ # Identifier
194
+ Identifier = paste0(sapply(names(self $ identifiers ),function (name ){
195
+ outid <- paste(name , self $ identifiers [[name ]],sep = " :" )
196
+ return (outid )
197
+ }),collapse = line_separator ),
198
+ # Email
199
+ Email = if (! is.null(self $ email )) self $ email else " " ,
200
+ # OrganizationName
201
+ OrganizationName = if (! is.null(self $ organizationName )) self $ organizationName else " " ,
202
+ # PositionName
203
+ PositionName = if (! is.null(self $ positionName )) self $ positionName else " " ,
204
+ # LastName
205
+ LastName = if (! is.null(self $ lastName )) self $ lastName else " " ,
206
+ # FirstName
207
+ FirstName = if (! is.null(self $ firstName )) self $ firstName else " " ,
208
+ # PostalAddress
209
+ PostalAddress = if (! is.null(self $ postalAddress )) self $ postalAddress else " " ,
210
+ # PostalCode
211
+ PostalCode = if (! is.null(self $ postalCode )) self $ postalCode else " " ,
212
+ # City
213
+ City = if (! is.null(self $ city )) self $ city else " " ,
214
+ # Country
215
+ Country = if (! is.null(self $ country )) self $ country else " " ,
216
+ # Voice
217
+ Voice = if (! is.null(self $ voice )) self $ voice else " " ,
218
+ # Facsimile
219
+ Facsimile = if (! is.null(self $ facsimile )) self $ facsimile else " " ,
220
+ # WebsiteUrl
221
+ WebsiteUrl = if (! is.null(self $ websiteUrl )) self $ websiteUrl else " " ,
222
+ # WebsiteName
223
+ WebsiteName = if (! is.null(self $ websiteName )) self $ websiteName else " " ,
224
+ stringsAsFactors = FALSE
225
+ )
226
+ return (out )
184
227
}
185
228
186
229
)
0 commit comments