clean.zipcodes(zipcode)
clean.zipcodes()所属R语言包:zipcode
clean up and standardize ZIP codes
清理和规范ZIP代码
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Attempts to detect and clean up suspected ZIP codes. Will strip "ZIP+4" suffixes to match format of zipcode data.frame. Restores leading zeros, converts invalid entries to NAs, and returns character vector. Note that this function does not attempt to find a matching ZIP code in the database,
尝试可疑的ZIP代码来检测和清除。将去掉“ZIP +4”后缀,邮编数据框的格式相匹配。恢复到NAS,前导零,将无效的项目,并返回字符向量。注意,这个函数不会试图找到一个匹配的ZIP代码在数据库中,
用法----------Usage----------
clean.zipcodes(zips)
参数----------Arguments----------
参数:zips
character vector of suspect entries, will be cast if non-character
字符向量的犯罪嫌疑人的条目,如果不将投个字符
值----------Value----------
character vector containing cleaned ZIP codes with NAs for non-conforming entries
字符向量的清洗与NAS的ZIP代码不相符的项目
(作者)----------Author(s)----------
Jeffrey Breen <jeffrey@atmosgrp.com>
实例----------Examples----------
# given a mix of possible zip codes, including ZIP+4 and foreign postal codes,[混合可能的邮政编码,包括ZIP +4和外国邮政代码,]
# attempt to identify valid zip codes and return character vector:[试图找出有效的邮政编码和返回的字符向量:]
zips = c(2061, "02142", 2043, "20210", "2061-2203", "SW1P 3JX", "210", '02199-1880')
clean.zipcodes(zips)
# [1] "02061" "02142" "02043" "20210" "02061" NA "00210" "02199" [[1]“02061”,“02142”,“02043”,“20210”,“02061”NA“00210”,“02199”]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|