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

Error in serialize(object, connection = NULL, ascii = ascii) : object 'direction' not found #6

Closed
englianhu opened this issue Dec 12, 2015 · 4 comments

Comments

@englianhu
Copy link

Used to work few months ago, updated to latest version but faced below error.

> library('directlabels')
> direct.label(ggplot(melted, aes(x=Sess, y=value/1000000, fill=variable, color=variable)) + geom_bar(stat='identity', colour='black', position='dodge') + xlab('Year') + ylab("HKD ('000,000)") + theme_wsj(base_family='Verdana') + scale_colour_wsj('colors6', '') + ggtitle("Annual Turnover and P&L HKD ('000,000)"), list(last.bumpup,hjust=0.45,cex=0.65))
- Error in serialize(object, connection = NULL, ascii = ascii) : 
-   object 'direction' not found
@tdhock
Copy link
Owner

tdhock commented Dec 15, 2015

I can't help you without a minimal reproducible example. Please post one here or on stackoverflow http://stackoverflow.com/search?q=directlabels

@tdhock tdhock closed this as completed Nov 23, 2016
@ringprince
Copy link

I am seeing the same issue. It happens when I use the theme_fivethirtyeight.

Here is a reproducible example:

library("dplyr")
library("ggplot2")
library("directlabels")
library("ggthemes")

## create data
aaa <- structure(
  list(x = c(28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 
             18, 17, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17),
       count = c(2344L, 
                 4088L, 3247L, 2808L, 2046L, 1669L, 1315L, 951L, 610L, 543L, 469L, 
                 370L, 937L, 1116L, 550L, 379L, 282L, 204L, 174L, 160L, 136L, 
                 132L, 128L, 122L),
       term = c("aaa", "aaa", "aaa", "aaa", "aaa", 
                "aaa", "aaa", "aaa", "aaa", "aaa", "aaa", "aaa", "bbb", "bbb", 
                "bbb", "bbb", "bbb", "bbb", "bbb", "bbb", "bbb", "bbb", "bbb", 
                "bbb")),
  class = c("tbl_df", "tbl", "data.frame"),
  row.names = c(NA, 
                -24L),
  .Names = c("x", "count", "term"))
## have a look
aaa

## initial plot
p2 <- aaa %>% ggplot(aes(x = x, y = count, group = term, colour = term)) + geom_line()
## have a look
p2

## works
direct.label(p2)



## plot with theme
p2 <- aaa %>% ggplot(aes(x = x, y = count, group = term, colour = term)) + geom_line() + theme_fivethirtyeight()
## have a look
p2

## fails
direct.label(p2)
## Error in base::serialize(object, connection = NULL, ascii = ascii, version = serializeVersion) :
##   object 'direction' not found

@mohinbanker
Copy link

I also have this error and haven't been able to find a solution. Is there a way to fix it?

@tdhock tdhock reopened this Apr 20, 2020
@tdhock
Copy link
Owner

tdhock commented Jun 20, 2020

hi thanks for the bug reports and the reproducible example. it is fixed in #25

@tdhock tdhock closed this as completed Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants