Thanks for your inputs. colClasses will be learned.
Joh
Prof Brian Ripley wrote:
> On Tue, 15 Apr 2008, jim holtman wrote:
>
>> Define those columns as being character with colClasses and then use
>> 'ifelse' to change it to boolean:
>>
>>> x <- c("", "", "+", "", "+")
>>> x
>> [1] "" "" "+"
On Tue, 15 Apr 2008, jim holtman wrote:
> Define those columns as being character with colClasses and then use
> 'ifelse' to change it to boolean:
>
>> x <- c("", "", "+", "", "+")
>> x
> [1] "" "" "+" "" "+"
>> y <- ifelse(x == "", FALSE, TRUE)
>> y
> [1] FALSE FALSE TRUE FALSE TRUE
Or defi
Define those columns as being character with colClasses and then use
'ifelse' to change it to boolean:
> x <- c("", "", "+", "", "+")
> x
[1] "" "" "+" "" "+"
> y <- ifelse(x == "", FALSE, TRUE)
> y
[1] FALSE FALSE TRUE FALSE TRUE
>
On Tue, Apr 15, 2008 at 5:10 AM, Johannes Graumann
<[EMAIL
Hi,
I read in some tabular data using this:
> read.table(file, quote = "\"", header = TRUE, sep = "\t",
> stringsAsFactors > = FALSE, comment.char = "")
One slight problem I have now is that some columns in the data set contain
either "" or "+", which means FALSE or TRUE respectively. The
4 matches
Mail list logo