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

Missing value where TRUE/FALSE needed #17

Open
breandan opened this issue Jan 13, 2019 · 2 comments
Open

Missing value where TRUE/FALSE needed #17

breandan opened this issue Jan 13, 2019 · 2 comments
Assignees

Comments

@breandan
Copy link

Encountered this error when plotting with geomLine:

Exception in thread "main" Script:
library(ggplot2)
library(dplyr)
library(readr)
library(scales)
library(forcats)



data01 = read_tsv("/tmp/.txt9217350101246720089.tmp")

set.seed(2009)

gg = ggplot(mapping=aes(x=`x`,y=`y`,color=`Function`), data=data01) + 
	geom_line(stat='identity', position=position_identity(), na.rm=FALSE, inherit.aes=TRUE, size=1.0) + 
	ggtitle("Derivatives of y=(x^(x))")

ggsave(filename="/home/breandan/IdeaProjects/kotlingrad/src/main/resources/plot.png", plot=gg)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union


Attaching package: ‘scales’

The following object is masked from ‘package:readr’:

    col_factor

Parsed with column specification:
cols(
  x = col_double(),
  y = col_double(),
  Function = col_character()
)
Saving 7 x 7 in image
Error in if (score > best$score && (!only.loose || (lmin <= dmin && lmax >=  : 
  missing value where TRUE/FALSE needed
Calls: ggsave ... f -> <Anonymous> -> f -> <Anonymous> -> <Anonymous>
Execution halted
	at kravis.render.LocalR.render$kravis(LocalR.kt:23)
	at kravis.GGPlot.save(GGPlot2.kt:164)
	at kravis.GGPlot.save$default(GGPlot2.kt:162)
	at edu.umontreal.kotlingrad.samples.TestPlotKt.main(TestPlot.kt:46)

Code follows:

    val xs = 0.0..5.0 step 0.09
    val ys = (xs.map { listOf(it, y(it), "y") }
            + xs.map { listOf(it, dy_dx(it), "dy/dx") }
            + xs.map { listOf(it, `d²y_dx²`(it), "d²y/x²") }
            + xs.map { listOf(it, `d³y_dx³`(it), "d³y/dx³") }
            + xs.map { listOf(it, `d⁴y_dx⁴`(it), "d⁴y/dx⁴") }
            + xs.map { listOf(it, `d⁵y_dx⁵`(it), "d⁵y/dx⁵") }
      ).flatten()

    dataFrameOf("x", "y", "Function")(ys)
      .plot(x = "x", y = "y", color = "Function")
      .geomLine(size = 1.0)
      .title("Derivatives of y=$y")
      .save(File("src/main/resources/plot.png"))
@holgerbrandl holgerbrandl self-assigned this Jan 10, 2021
holgerbrandl added a commit that referenced this issue Jan 10, 2021
@holgerbrandl
Copy link
Owner

I know it's been a while. I've simplified the example to get rid of the differentiation. But then it seems to work fine.

image

@holgerbrandl
Copy link
Owner

Please also see started test in referenced commit

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

2 participants