What I tried to do:
In aphid package there is a function deriveHMM() which needs to be fed with a list like:
x <- list(c("c"="10.0", "b"="5.0","c"="10.0", "a"="1.0", "a"="2.0",...))
which needs to be created of a very large input vector like
iv <- c(10, 5, 10, 1, 2,...)
It is important, that the order of my original input vector remains unchanged.
I need to automatically create this list by a large input of doubles from a .csv file (import of doubles to R worked fine). Each double has to get a name depending on its closest distance to a predefined value, for example:
- all doubles ranging from 0 to 2.5 should be named "a"
- all doubles ranging from 2.5 to 7.5 should be named "b"
- all doubles greater than 7.5 should be named "c"
and after that all doubles be converted to a character (or string (?)) so the method deriveHMM() accepts the input.
I would be very happy to have suggestions. I am new to R and this is my first post on Stackoverflow.com. I am not an experienced programmer, but I try my best to understand your help.
EDIT:
Updated the question, because what I need is a "List of named vectors of characters", exactly like in my example above without changing the order.