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

Using concat.split on data containing an apostrophe causes error #21

Closed
IrwinKwan opened this issue Dec 10, 2013 · 2 comments
Closed

Using concat.split on data containing an apostrophe causes error #21

IrwinKwan opened this issue Dec 10, 2013 · 2 comments
Assignees
Labels

Comments

@IrwinKwan
Copy link

concat.split doesn't appear to like apostrophes in the data column.

> df <- data.frame(experience=c("Did Use, Didn't like"))
> df
            experience
1 Did Use, Didn't like
> concat.split(df, 1)
Error in FUN(NA_integer_[[1L]], ...) : 
  argument must be coercible to non-negative integer

If you try it without, it works fine.

I installed it from the package manager, appears to be v1.2.0.

Mac OS X x64, Mavericks

R 3.0.2

@mrdwab
Copy link
Owner

mrdwab commented Dec 10, 2013

@IrwinKwan, thanks for the reproducible report. It seems to be because of the use of read.table without the "quote" argument.

read.table(text = as.character(df$experience), header = FALSE, sep = ",")
# [1] V1 V2
# <0 rows> (or 0-length row.names)

But:

read.table(text = as.character(df$experience), header = FALSE, sep = ",", quote="")
#        V1           V2
# 1 Did Use  Didn't like

I'll see what can be done to fix this quickly. It may be that just adding the quote = "" to the functions would be sufficient, but I will need to test it on a few more cases.

@ghost ghost assigned mrdwab Dec 10, 2013
@mrdwab
Copy link
Owner

mrdwab commented Oct 8, 2014

Resolved by converting concat.split to use cSplit instead of read.concat in 45cd5f8

@mrdwab mrdwab closed this as completed Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants