Giter Site home page Giter Site logo

modeest's People

Contributors

paulponcet avatar wibeasley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

modeest's Issues

Calculating mode on factor

I have found this question on stackoverflow . When trying to calculate the mode from a factor like this:

color <- c("blue","green","blue","blue","green","yellow","pink","blue")
color <- as.factor(color)

The mode is NA:

mlv.factor(x=color,method='mfv')

Mode (most frequent value): NA 
Bickel's modal skewness: -2 
Call: mlv.factor(x = color, method = "mfv") 
Warning message:
In discrete(x, ...) : NAs introduced by coercion

I have looked into the function an found that mlv.factor() calls discrete():
th <- discrete(x, ...)

f <- factor(x)
f
[1] blue   green  blue   blue   green  yellow pink   blue  
Levels: blue green pink yellow

tf <- tabulate(f)
tf
[1] 4 2 1 1

as.numeric(levels(f)[tf == max(tf)])
[1] NA
Warning message:
NAs introduced by coercion 

It cannot coerce "blue" to numeric, hence the function does not return anything.

argument 'x' contains missing values

Estimating the mode of a trimmed G prime set using the 'modeest' package...
Error: argument 'x' contains missing values

I encountered the above error. Please help.

Encoding

Hi @polmath, I don't understanding file encoding issues well, and I typically run away from them, or take the path of least resistance.

In case it helps you to know, it may be difficult for Americans to edit and resubmit existing code. Characters like the accented 'e' in the file below aren't interpreted correctly with my installations of RStudio, Notepad++, Notepad, or NetBeans. From what I could tell, the GitHub browser did a better job, so I edited it directly in there.

I'm not saying you should change anything so it's easier for us to work with. But I wanted to let you know there might be extra friction/obstacles developing.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.