discrete

How to zoom in on a specific range of values for a categorical variable in ggplot2?

北城以北 提交于 2021-02-20 02:20:55
问题 I just want to zoom in on the x-axis between the values ford and nissan in the mpg dataframe. Package used: tidyverse But I am getting the following error when using the coord_cartesian() function: p<-ggplot(mpg,aes(x=manufacturer,y=class)) p+geom_point()+ + coord_cartesian(xlim = c('ford','nissan')) Error in +coord_cartesian(xlim = c("ford", "nissan")) : invalid argument to unary operator 回答1: You can use a function for contextual zoom from ggforce package ( facet_zoom ) to achieve this: #

How to zoom in on a specific range of values for a categorical variable in ggplot2?

南笙酒味 提交于 2021-02-20 02:16:39
问题 I just want to zoom in on the x-axis between the values ford and nissan in the mpg dataframe. Package used: tidyverse But I am getting the following error when using the coord_cartesian() function: p<-ggplot(mpg,aes(x=manufacturer,y=class)) p+geom_point()+ + coord_cartesian(xlim = c('ford','nissan')) Error in +coord_cartesian(xlim = c("ford", "nissan")) : invalid argument to unary operator 回答1: You can use a function for contextual zoom from ggforce package ( facet_zoom ) to achieve this: #

How to zoom in on a specific range of values for a categorical variable in ggplot2?

最后都变了- 提交于 2021-02-20 02:16:06
问题 I just want to zoom in on the x-axis between the values ford and nissan in the mpg dataframe. Package used: tidyverse But I am getting the following error when using the coord_cartesian() function: p<-ggplot(mpg,aes(x=manufacturer,y=class)) p+geom_point()+ + coord_cartesian(xlim = c('ford','nissan')) Error in +coord_cartesian(xlim = c("ford", "nissan")) : invalid argument to unary operator 回答1: You can use a function for contextual zoom from ggforce package ( facet_zoom ) to achieve this: #

R: Can I analyze non-varying-across-individual alternative-specific attribute variables with mlogit?

人走茶凉 提交于 2021-01-29 10:39:44
问题 I'm new to discrete choice modeling, so my apologies if I am misunderstanding a fundamental aspect of the analysis. I would like to run a discrete choice analysis with an individual-specific variable and what I think are alternative-specific attribute variables. From the mlogit vignette I think the individual-specific variable is a "choice situation specific covariate" (in the new vignette) and the alternative-specific attribute variables are "alternative specific covariates with generic

Specification of Multinomial model in Tensorflow Probability

纵然是瞬间 提交于 2020-04-17 23:46:13
问题 I am playing with a mixed multinomial discrete choice model in Tensorflow Probability. The function should take an input of a choice among 3 alternatives. The chosen alternative is specified by CHOSEN (a # observationsx3 tensor). I have a previous question but the code/question has changed quite a bit: Tensorflow Probability Error: OperatorNotAllowedInGraphError: iterating over `tf.Tensor` is not allowed Looking at the source code for Multinomial(), I should be able to give CHOSEN as an input