Displaying 3 results from an estimated 3 matches for "list_of_world_heritage_in_danger".
2016 Apr 25
1
Please assist -- Unable to remove '-' character from char vector--
...-deal-with-escaped-unicode-characters-in-r-e-g-the-em-dash
splitends<-sapply(end,strsplit,"-|\u2013|,")
where '\u2013' is, i guess, the unicode for en-dash/em-dash character
in the ranges values.
I had scrapped the HTML table from this web page :
https://en.wikipedia.org/wiki/List_of_World_Heritage_in_Danger
and range values does have en-dash characters.
For now the issue is resolved but how does one capture values similar
to '\u2013' for other possible special cases to be specified in the
regex ?
Regards,
Sunny Singha.
On Mon, Apr 25, 2016 at 12:39 PM, Jim Lemon <drjimlemon at gmail.co...
2016 Apr 25
0
Please assist -- Unable to remove '-' character from char vector--
Hi Sunny,
Try this:
# notice that I have replaced the fancy hyphens with real hyphens
end<-c("2001-","1992-","2013-","2013-","2013-","2013-",
"1993-2007","2010-","2012-","1984-1992","1996-","2015-")
splitends<-sapply(end,strsplit,"-")
last_bit(x)
2016 Apr 25
3
Please assist -- Unable to remove '-' character from char vector--
Hi,
I have a char vector with year values. Some cells have single year
value '2001-' and some have range like 1996-2007.
I need to remove hyphen character '-' from all the values within the
character vector named as 'end'. After removing the hyphen I need to
get the last
number from the cells where there are year range values i.e if the
cell has range 1996-2007, the code