Character vectors: paste

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Character vectors: paste

Sandra Garcia Galiano
Hello,

Does anyone knows how I can paste in a character vector the following
names of maps?
LST2007001_1_16
LST2007017_1_16
LST2007033_1_16
..
LST2007353_1_16
LST2008001_1_16
..

How I can implement this in R?

Thanks in advance,

Sandra
UPCT
(may be it is too basic ! excuse me, I am learning R).



Reply | Threaded
Open this post in threaded view
|

Character vectors: paste

Sarah Goslee
Sandra,

It isn't clear what you want.

Do you want to enter these names at the console? Or
do you have the names in a text file you'd like to
read in?

If the former,
mynames <- c("name1", "name2", "name3")
will create a vector containing the names.

If the latter,
mynames <- read.table("allnames.txt", as.is=TRUE)
will read the names into a data.frame that you can
convert to a vector using as.vector()

The R-help newsgroup is great for basic R questions that
don't really relate to geography topics.

Sarah

On Thu, Jul 24, 2008 at 3:16 PM,  <Sandra.Garcia at upct.es> wrote:

> Hello,
>
> Does anyone knows how I can paste in a character vector the following
> names of maps?
> LST2007001_1_16
> LST2007017_1_16
> LST2007033_1_16
> ..
> LST2007353_1_16
> LST2008001_1_16
> ..
>
> How I can implement this in R?
>
> Thanks in advance,
>
> Sandra
> UPCT
> (may be it is too basic ! excuse me, I am learning R).
>


--
Sarah Goslee
http://www.functionaldiversity.org