facet

Why this facet_grid doesn't delete columns?

泄露秘密 提交于 2019-12-01 20:21:07
Hi have this dataset : tdat=structure(list(Condition = structure(c(1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L), .Label = c("AS", "Dup", "MCH"), class = "factor"), variable = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("Bot", "Top", "All"), class = "factor"), value = c(1.782726022, 1, 2.267946449, 1.095240234, 1, 1.103630141, 1.392545278, 1, 0.854984833, 4.5163067, 1, 4.649271897, 0.769428018, 1, 0.483117123, 0.363854608, 1, 0.195799358, 0

ggplot - facet by function output

微笑、不失礼 提交于 2019-12-01 15:59:14
I'm unsure how to facet by a function of the data in the data element of a ggplot object. In the following toy example, what I want to do is something like this: df <- data.frame(x=1:8, y=runif(8), z=8:1) ggplot(df, aes(x=x, y=y)) + geom_point() + facet_wrap( ~ (z %% 2)) But that gives the error: Error in layout_base(data, vars, drop = drop) : At least one layer must contain all variables used for facetting . I can achieve the desired result by transforming the data frame: ggplot(transform(df, z=z%%2), aes(x=x, y=y)) + geom_point() + facet_wrap( ~ z) but often it's desirable to not use such a

Multiple ranges in a facet in solr

旧巷老猫 提交于 2019-12-01 14:11:51
How could you format a Solr facet query to include two page view ranges? The following will only return the 200 TO 250 range and nothing from the 500 to 550 range. <str name="fq">pageviews:[200 TO 250] OR [500 TO 550]</str> I'm keen to get the number of records matching people with pages views between 200 and 250 and between 500 and 550. You can also use it as shown below. fq=pageviews:([200 TO 250] OR [500 TO 550]) Turns out I need to mention the field each time: pageviews:[200 TO 250] OR pageviews:[500 TO 550] I believe that the complete answer to this question should include a way to

how to add component programmatically/dynamically to a p:dataTable facet

家住魔仙堡 提交于 2019-12-01 14:03:03
I'm trying to add a global filter for my <p:dataTable> of which I create programmatically from a managed bean. The table works fine and renders correctly, however only the last added component is rendered in the datatable facet. Here is the code I tried: //config FacesContext fc = FacesContext.getCurrentInstance(); Application application = fc.getApplication(); ExpressionFactory ef = application.getExpressionFactory(); ELContext elc = fc.getELContext(); //Table table = (DataTable) application.createComponent(DataTable.COMPONENT_TYPE); table.setId("tabexam"); table.setValue(listexam); table

how to add component programmatically/dynamically to a p:dataTable facet

岁酱吖の 提交于 2019-12-01 11:54:35
问题 I'm trying to add a global filter for my <p:dataTable> of which I create programmatically from a managed bean. The table works fine and renders correctly, however only the last added component is rendered in the datatable facet. Here is the code I tried: //config FacesContext fc = FacesContext.getCurrentInstance(); Application application = fc.getApplication(); ExpressionFactory ef = application.getExpressionFactory(); ELContext elc = fc.getELContext(); //Table table = (DataTable) application

Multiple ranges in a facet in solr

馋奶兔 提交于 2019-12-01 11:35:13
问题 How could you format a Solr facet query to include two page view ranges? The following will only return the 200 TO 250 range and nothing from the 500 to 550 range. <str name="fq">pageviews:[200 TO 250] OR [500 TO 550]</str> I'm keen to get the number of records matching people with pages views between 200 and 250 and between 500 and 550. 回答1: You can also use it as shown below. fq=pageviews:([200 TO 250] OR [500 TO 550]) 回答2: Turns out I need to mention the field each time: pageviews:[200 TO

Facetting in ggplot2

醉酒当歌 提交于 2019-12-01 09:37:21
I have this dataset: https://dl.dropboxusercontent.com/u/73950/data.csv The dataset contains 3 variables. Here's how I visualize the data right now: library(ggplot2) library(reshape2) library(RColorBrewer) dat = read.csv("data.csv", header = FALSE) myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral"))) sc <- scale_colour_gradientn(colours = myPalette(100)) ggplot(dat, aes(x=V1, y=V3, colour = V2))+ geom_point(alpha = .2,size = 3) + sc Instead of just one figure, I'd like to facet the figure to display 3 different ways to attribute variables to each axis and color. As such: x = V1, y =

Facetting in ggplot2

梦想与她 提交于 2019-12-01 08:09:29
问题 I have this dataset: https://dl.dropboxusercontent.com/u/73950/data.csv The dataset contains 3 variables. Here's how I visualize the data right now: library(ggplot2) library(reshape2) library(RColorBrewer) dat = read.csv("data.csv", header = FALSE) myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral"))) sc <- scale_colour_gradientn(colours = myPalette(100)) ggplot(dat, aes(x=V1, y=V3, colour = V2))+ geom_point(alpha = .2,size = 3) + sc Instead of just one figure, I'd like to facet the

Separate palettes for facets in ggplot facet_grid

久未见 提交于 2019-12-01 06:42:07
Question How can I use a different color palette for each facet? Ideally I would like to have a generic legend in gray to serve as a reference. I'm working on a visualization using ggplot's facet_grid. The layout is fine, but I would like to use a distinct color palette for every row in the grid. My goal is to use a similarly-shaded gradient for every palette and then tie them together with a grayscale legend. I'm would like to do this to maintain internal color-coding consistency within a larger set of graphics. It would amazing to be able to still use facet_grid instead of using grobs (with

Separate palettes for facets in ggplot facet_grid

时光毁灭记忆、已成空白 提交于 2019-12-01 05:03:17
问题 Question How can I use a different color palette for each facet? Ideally I would like to have a generic legend in gray to serve as a reference. I'm working on a visualization using ggplot's facet_grid. The layout is fine, but I would like to use a distinct color palette for every row in the grid. My goal is to use a similarly-shaded gradient for every palette and then tie them together with a grayscale legend. I'm would like to do this to maintain internal color-coding consistency within a