Question

i have data table look like

this is my code

while(i<=gh)
{
    fg<-rownames(L2_table)
    na<-fg[i]
    temp<-data.frame()
    temp<-comb[,na]
    gh<-gh+1
}

but here variable na is not working.it stored as "2" so i couldn't use as comb[,na].how to over come this?

i want output as if row name is 1 take column 1 of comb and so on?

Was it helpful?

Solution

comb[,as.numeric(temp[1])]

comb[,as.numeric(temp[3])]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top