Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap columns should be ordered as they are in the input csv #10

Open
cnobles opened this issue Jun 10, 2016 · 0 comments
Open

Heatmap columns should be ordered as they are in the input csv #10

cnobles opened this issue Jun 10, 2016 · 0 comments

Comments

@cnobles
Copy link

cnobles commented Jun 10, 2016

Whenever the 'patient' column is read from the samples.csv, they are changed to a factor. This is fine, but the factor levels are reordered according to the contents of the column, sorted or what not. We should relabel the factor levels to order that the samples were input. Example below:

test <- c("pHIVP12_d0", "pHIVP12_d7", "pHIVP12_d14", "pHIVP12_d21", "pHIVP12_d28")
factor(test)
[1] pHIVP12_d0 pHIVP12_d7 pHIVP12_d14 pHIVP12_d21 pHIVP12_d28
Levels: pHIVP12_d0 pHIVP12_d14 pHIVP12_d21 pHIVP12_d28 pHIVP12_d7
unique(test)
[1] "pHIVP12_d0" "pHIVP12_d7" "pHIVP12_d14" "pHIVP12_d21" "pHIVP12_d28"
factor(test, levels=unique(test))
[1] pHIVP12_d0 pHIVP12_d7 pHIVP12_d14 pHIVP12_d21 pHIVP12_d28
Levels: pHIVP12_d0 pHIVP12_d7 pHIVP12_d14 pHIVP12_d21 pHIVP12_d28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant