trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

Ldist not found in name2sex #145

Closed trinker closed 10 years ago

trinker commented 11 years ago

Dear Tyler

Thank you for your post regarding name2sex at https://github.com/trinker/qdap/blob/master/R/name2sex.R

When ever I run the function in R i get this

error: Error in which.min(Ldist(pattern, sector[, 1])) :
  could not find function "Ldist"

I this Ldist from some package i don't have. I've tried finding it on the web, but i can't.

Where do i find Ldist

Thank you

Alexander Jacobsen

trinker commented 11 years ago

I'm not sure what's happening. I get no such error. Ldist is an internal function in qdap so using qdap:::List should allow you to see it. You can see it here: https://github.com/trinker/qdap/blob/master/R/Ldist.R

Have you tried updating qdap recently?

I need more information. Please use: sessionInfo()

trinker commented 10 years ago

No response so I'm closing.

alja09ac commented 10 years ago

Sorry for my late reply. I've been very busy. Okay it worked, I added the extra function for Ldist, and it works, and thanks for the help.

alja09ac commented 10 years ago

I do have a problem though. My first names is in a table

Firstname 1 Connie 2 Janeth 3 Will 4 Luny 5 Andhita 6 Morgane 7 Morgane 8 Samara 9 Samara 10 Samara

And when i fun the function: test<-name2sex(firstnames) it only returns "structure(1L, .Label = "F", class = "factor")" for one name. Since I have 1 million names, I cant write them all in the console. How to I make the function interpret the whole table? This might be a fundamental question for R, but I'm unable to find the question anywhere.

trinker commented 10 years ago

Using names2sex on that many pieces of data will take a long time particularly if you set pred.sex =TRUE and fuzzy.match = TRUE. The code was intended for much smaller data sets and thus is not optimized. I think you need to spend some time with the R intro manual http://cran.r-project.org/doc/manuals/R-intro.html and get to know about structures and indexing. Currently I can't help because you haven't provided information about your dta (use str function), you just say it's a table. I strongly suspect you actually have a data.frame not a table. You need to use indexing. The intro manuals cover indexing in R.

Tyler

On Sun, Dec 1, 2013 at 3:41 PM, alja09ac notifications@github.com wrote:

I do have a problem though. My first names is in a table

Firstname 1 Connie 2 Janeth 3 Will 4 Luny 5 Andhita 6 Morgane 7 Morgane 8 Samara 9 Samara 10 Samara

And when i fun the function: test<-name2sex(firstnames) it only returns "structure(1L, .Label = "F", class = "factor")" for one name. Since I have 1 million names, I cant write them all in the console. How to I make the function interpret the whole table? This might be a fundamental question for R, but I'm unable to find the question anywhere.

— Reply to this email directly or view it on GitHubhttps://github.com/trinker/qdap/issues/145#issuecomment-29582552 .

alja09ac commented 10 years ago

Yes I'm new to R. I will read the material. Thank you very much for your help. I really appreciate it.

alja09ac commented 10 years ago

I'm using a data.frame by the way