Displaying 2 results from an estimated 2 matches for "bahbah".
Did you mean:
baah
2005 Apr 27
3
assign to an element of a vector
I am trying to find a way to assign values to elements of a vector
that will be defined by a user. So I don't have the name of the vector
and cannot hard code the assignment in advance. In the example below I
have to get() the vector using its name. When I try to assign to an
element I get an error:
> a <- c(1,2,3)
> get('a')[1] <- 0
Error: Target of assignment expands to
2013 Nov 17
4
quotation marks and scan
Dear R People:
I'm sure that this is a very simple problem, but I have been wresting with
it for some time.
I have the following file that has the following one line:
CRS("+init=epsg:28992")
Fair enough. I scan it into R and get the following:
> u
[1] "CRS(\"+init=epsg:28992\")"
> gsub(pattern='\"',replacement='"',x=u)
[1]