Claro que si!  Mucho mas elegante   Gracias, Daniel.   --JIV

On Thu, Jul 5, 2012 at 5:01 PM, daniel <> wrote:

> A mi me funciona:
>
> > sessionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Spanish_Argentina.1252  LC_CTYPE=Spanish_Argentina.1252
> [3] LC_MONETARY=Spanish_Argentina.1252 LC_NUMERIC=C
> [5] LC_TIME=Spanish_Argentina.1252
>
> attached base packages:
> [1] graphics  grDevices utils     datasets  stats     methods   base
>
> other attached packages:
> [1] devtools_0.6  plyr_1.7.1    stringr_0.6   ggplot2_0.9.1
>
> loaded via a namespace (and not attached):
>  [1] colorspace_1.2-0   dichromat_1.2-4    digest_0.5.2       grid_2.15.0
>
>  [5] labeling_0.2       MASS_7.3-18        memoise_0.1        munsell_0.3
>
>  [9] proto_0.3-9.2      RColorBrewer_1.0-5 RCurl_1.91-1.1
> reshape2_1.2.1
> [13] scales_0.2.1       tools_2.15.0
>  > x <- c("PC DELL P4 3.0 GHZ 512MB 150GB CD FDD LA",
> + "PC LTEL Celeron 1.7 GHz",
> + "PC CEL 1.8 ASUS P5GC-DDR2 1/320GB/DVDRW",
> + "PC INTEL PENTIUM 4 CPU 2.40Ghz 512MB RAM",
> + "PC Founder P IV 2.8 GHz 80 GB",
> + "Monitor ACER VIEW",
> + "Monitor SUN 15¨",
> + "COMPUTADORA P4/2.8GHZ")
> >
> > sub(" .*","", x)
>  [1] "PC"          "PC"          "PC"          "PC"          "PC"
> [6] "Monitor"     "Monitor"     "COMPUTADORA"
>  >
>
>
> Daniel Merino
>
> 2012/7/5 Jorge I Velez <jorgeivanvelez@gmail.com>
>
>> Hola Leonardo,
>>
>> Podrias intentar:
>>
>> # datos
>> x <- structure(list(V1 = c("PC DELL P4 3.0 GHZ 512MB 150GB CD FDD LA",
>> "PC LTEL Celeron 1.7 GHz", "PC CEL 1.8 ASUS P5GC-DDR2 1/320GB/DVDRW",
>> "PC INTEL PENTIUM 4 CPU 2.40Ghz 512MB RAM", "PC Founder P IV 2.8 GHz 80
>> GB",
>> "Monitor ACER VIEW", "Monitor SUN 15¨", "COMPUTADORA P4/2.8GHZ"
>> )), .Names = "V1", row.names = c(NA, -8L), class = "data.frame")
>>
>> # resultados
>> sapply(with(xx, strsplit(V1, ' ')), "[", 1)
>> [1] "PC"          "PC"          "PC"          "PC"          "PC"
>> "Monitor"
>> [7] "Monitor"     "COMPUTADORA"
>>
>> Saludos,
>> Jorge.-
>>
>>
>> 2012/7/5 Leonardo Hernández Pérez <>
>>
>> >  Tengo una columna con estos datos
>> >
>> > PC DELL P4 3.0 GHZ 512MB 150GB CD FDD LA
>> > PC LTEL Celeron 1.7 GHz
>> > PC CEL 1.8 ASUS P5GC-DDR2 1/320GB/DVDRW
>> > PC INTEL PENTIUM 4 CPU 2.40Ghz 512MB RAM
>> > PC Founder P IV 2.8 GHz 80 GB
>> > Monitor ACER VIEW
>> > Monitor SUN 15¨
>> > COMPUTADORA P4/2.8GHZ
>> > Necesito extraer la primera palabra, lo cual quedaría:
>> >
>> > PC
>> > PC
>> > PC
>> > PC
>> > Monitor
>> > Monitor
>> > COMPUTADORA
>> > ¿Cómo Hacerlo?
>> >
>> > ---
>> > This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE
>> > running at host imx2.etecsa.cu
>> > Visit our web-site: <http://www.kaspersky.com>, <
>> http://www.viruslist.com>
>> >
>> > _______________________________________________
>> > R-help-es mailing list
>> > R-help-es@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-help-es
>> >
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>>
>>
>> _______________________________________________
>> R-help-es mailing list
>> R-help-es@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>>
>>
>
>
> --
> Daniel
>

	[[alternative HTML version deleted]]

