ESTE SCRIPT FUNCIONA PERFECTAMENTE, LA PREGUNTA QUE HACÍA SE REFERÍA A QUE
SI SERÍA POSIBLE QUE EN LA PROPIA TABLA CSV PUDIERAN ESTAR LOS NOMBRES DE
LOS ANTIBIOTICOS Y QUE EL ANÁLISIS PCA NO LO RECHACE POR SER CUALITATIVO,
QUE DE ALGUNA MANERA SE DIERA UNA INSTRUCCIÓN PARA EVITAR TENER QE HACER LO
DE rownames manualmente
setwd("D:/Public/Documents/R/FactoMineR/")
table1 <- read.table(file="antibioticos.csv", header=T, as.is=T,
sep=";")
rownames(table1) <-
c("Ampicillin","Oxacillin","Peniclina","Ciprofloxacina","Amikacina","Gentami
cina","Kanamicina","Ceftriaxone","Ceftazidima","Cefotaxima","Cefazolina","Ce
furoxima","Aztreonam","Cloranfenicol","Vancomicina","Eritromicina","Clindami
cina","Fosfomicina","Amoxicilina","Imipenem","Azitromicina","Ampicillin/Sulb
actan")
library(FactoMineR)
res.hcpc <- HCPC(res.pca, nb.clust=0, conso=0, min=3, max=10)
--
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece
Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de
Salud. La persona que envia este correo asume el compromiso de usar el servicio
a tales fines y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20131103/40226df6/attachment.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: antibioticos.csv
Type: application/vnd.ms-excel
Size: 331 bytes
Desc: no disponible
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20131103/40226df6/attachment.xlb>
Hola.
No sé si estoy entendiendo correctamente, pero ¿por qué no ubicas en el
archivo csv los nombres de las columnas directamente?
Con el archivo adjunto, creado a partir de la información que das, he
corrido las líneas que mencionas:
library(FactoMineR)
res.pca<- read.csv('antibioticos.csv',h=T,row.names=1)
res.hcpc <- HCPC(res.pca, nb.clust=0, conso=0, min=3, max=10)
Y todo ha funcionado correctamente.
Saludos.
2013/11/3 Dr. José A Betancourt Bethencourt <jbetancourt en
iscmc.cmw.sld.cu>
> ESTE SCRIPT FUNCIONA PERFECTAMENTE, LA PREGUNTA QUE HACÍA SE REFERÍA A QUE
> SI SERÍA POSIBLE QUE EN LA PROPIA TABLA CSV PUDIERAN ESTAR LOS NOMBRES DE
> LOS ANTIBIOTICOS Y QUE EL ANÁLISIS PCA NO LO RECHACE POR SER CUALITATIVO,
> QUE DE ALGUNA MANERA SE DIERA UNA INSTRUCCIÓN PARA EVITAR TENER QE HACER LO
> DE rownames manualmente
>
>
>
> setwd("D:/Public/Documents/R/FactoMineR/")
>
> table1 <- read.table(file="antibioticos.csv", header=T,
as.is=T,
>
> sep=";")
>
>
>
> rownames(table1) <-
>
c("Ampicillin","Oxacillin","Peniclina","Ciprofloxacina","Amikacina","Gentamicina","Kanamicina","Ceftriaxone","Ceftazidima","Cefotaxima","Cefazolina","Cefuroxima","Aztreonam","Cloranfenicol","Vancomicina","Eritromicina","Clindamicina","Fosfomicina","Amoxicilina","Imipenem","Azitromicina","Ampicillin/Sulbactan")
>
>
>
> library(FactoMineR)
>
>
>
>
>
> res.hcpc <- HCPC(res.pca, nb.clust=0, conso=0, min=3, max=10)
>
> _______________________________________________
> R-help-es mailing list
> R-help-es en r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>
>
--
«But Gwindor answered: 'The doom lies in yourself, not in your name.'»
JRR Tolkien
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20131103/56147767/attachment.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: antibioticos.csv
Type: text/csv
Size: 597 bytes
Desc: no disponible
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20131103/56147767/attachment.bin>
Hola Jose, que yo sepa, cuando usas read.table, la opcion header=T o TRUE (que veo usas en tu funcion) te permite indicar el nombre de las columnas directamente en el archivo .csv Saludos, Eric. On 11/03/2013 08:36 AM, Dr. José A Betancourt Bethencourt wrote:> ESTE SCRIPT FUNCIONA PERFECTAMENTE, LA PREGUNTA QUE HACÍA SE REFERÍA A > QUE SI SERÍA POSIBLE QUE EN LA PROPIA TABLA CSV PUDIERAN ESTAR LOS > NOMBRES DE LOS ANTIBIOTICOS Y QUE EL ANÁLISIS PCA NO LO RECHACE POR SER > CUALITATIVO, QUE DE ALGUNA MANERA SE DIERA UNA INSTRUCCIÓN PARA EVITAR > TENER QE HACER LO DE rownames manualmente > > > > setwd("D:/Public/Documents/R/FactoMineR/") > > table1 <- read.table(file="antibioticos.csv", header=T, as.is=T, > > sep=";") > > > > rownames(table1) <- > c("Ampicillin","Oxacillin","Peniclina","Ciprofloxacina","Amikacina","Gentamicina","Kanamicina","Ceftriaxone","Ceftazidima","Cefotaxima","Cefazolina","Cefuroxima","Aztreonam","Cloranfenicol","Vancomicina","Eritromicina","Clindamicina","Fosfomicina","Amoxicilina","Imipenem","Azitromicina","Ampicillin/Sulbactan") > > > > library(FactoMineR) > > > > > > res.hcpc <- HCPC(res.pca, nb.clust=0, conso=0, min=3, max=10) > > > > _______________________________________________ > R-help-es mailing list > R-help-es en r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es >