facet

R how to add facet labels for pyramid like plot in ggplot2

我只是一个虾纸丫 提交于 2019-12-06 06:00:56
I have created pyramid like plot and I want to add labels for each side of the plot (something like facet labels). My data: dt <- data.frame(Answer = factor(x = rep(x = c(1:3), times = 2), labels = c("Yes", "No", "Maybe")), Gender = factor(x = rep(x = c(1:2), each = 3), labels = c("Female", "Male")), Prc = c(74.4, 25.0, 0.6, 61.3, 35.5, 3.2), label = c("74.4%", "25.0%", "0.6%", "61.3%", "35.5%", "3.2%")) My plot: My code for plot generation: xmi <- -70 xma <- 80 library(ggplot2) ggplot(data = dt, aes(x = Answer, fill = Gender)) + geom_bar(stat = "identity", subset = .(Gender == "Female"), aes

How to change one specific facet in ggplot

﹥>﹥吖頭↗ 提交于 2019-12-06 05:12:15
问题 I created pie charts displaying different scores (0 - 100%) in ggplot with the help of facet_grid(). However the last score is a total score combining the other scores and in order to distinguish it better from the other scores I would like to change the parameters for this specific facet. Ideally, I would like to make the facet-label bold and move the facet a bit further away from the other facets, but I have no idea how to change the parameters of only one specific facet. library(ggplot2)

ElasticSearch - Statistical facet on length of string field

僤鯓⒐⒋嵵緔 提交于 2019-12-06 04:40:50
问题 I would like to retrieve data about a string field like the min, max and average length (by counting the number of characters inside the string). My issue is that aggregations can only be used for numeric fields. Besides, I tried it using a simple statistical facet, "query":{ "match_all": {} }, "facets":{ "stat1":{ "statistical":{ "field":"title"} } } but I get shard failures and SearchPhaseExecutionException. When trying with a script field the error returned is an OutOfMemoryError: "query":

Extract single plot from ggplot with facet_grid

强颜欢笑 提交于 2019-12-06 02:21:08
I want to produce some plots using ggplot and facet_grid and save the plot as an object. My problem is that I also want to save each subgroup (i.e. each facet) as an object separately. My question is now if you can extract a single facet from facet_grid and save it as an object? Here is some simple code: library(ggplot2) ggplot(data = mtcars, aes(x = disp, y = mpg)) + geom_point() + facet_grid(. ~ am) Now I'd like to produce two objects - one for am=0 and one for am=1 . I'm not sure why you wouldn't use subsetting, but you can extract individual facets from a facet grid. library(ggplot2)

How to find most used phrases in elasticsearch?

我是研究僧i 提交于 2019-12-06 00:56:04
问题 I know that you can find most used terms in an index with using facets. For example on following inputs: "A B C" "AA BB CC" "A AA B BB" "AA B" term facet returns this: B:3 AA:3 A:2 BB:2 CC:1 C:1 But I'm wondering that is it possible to list followings: AA B:2 A B:1 BB CC:1 ....etc... Is there such a feature in ElasticSearch? 回答1: As mentioned in ramseykhalaf's comment, a shingle filter would produce tokens of length "n" words. "settings" : { "analysis" : { "filter" : { "shingle":{ "type":

how to search for more than one facet in solr?

一个人想着一个人 提交于 2019-12-06 00:30:32
I need to search for facets in solr as below: fq=country:usa fq=country:canada fq=topic:industrial fq=topic:political now i need to search for the articles that have the above facets (logical And) and (logical Or). suppose that i have the following articles country=USA France //Topic: Industrial Scientific country=USA canada //Topic: Industrial country=USA canada //Topic: Industrial political now, i have tried http://127.0.0.1:8888/solr/Collection1/select?q=*:*&start=0&rows=10&facet=true&fq=country:USA&fq=country:canada&fq=topic:political&fq=topic:industrial but this didnt return anything :(

Cannot create JPA Facet: “project facet jpt.jpa could not be found”

廉价感情. 提交于 2019-12-05 21:46:51
I have a maven project in Eclipse Java EE IDE for Web Developers. But when I go enable JPA facet, I cannot choose JPA (there is no JPA option). Have I forgotten to include some dependency? I've installed the following Maven dependencies: eclipslink-2.5.-RC1.jar, javax.persistence-2.0.0.jar, and mysql-connector-java-5.1.9.jar. I get the following warning on my project: Implementation of project facet jpt.jpa could not be found. Functionality will be limited. UPDATE : I have the Dali Java Persistence Tools installed. The JPA facet is not dependent on what is in your pom.xml. Check to make sure

Django Haystack faceting on the model type

爷,独闯天下 提交于 2019-12-05 10:59:31
I want to facet the results based on the different model_names (classes) returned. Is there an easy way to do this? Have you tried adding a SearchIndex field with this information? E.g. class NoteIndex(SearchIndex, indexes.Indexable): title = CharField(model_attr='title') facet_model_name = CharField(faceted=True) def get_model(self): return Note def prepare_facet_model_name(self, obj): return "note" class MemoIndex(SearchIndex, indexes.Indexable): title = CharField(model_attr='title') facet_model_name = CharField(faceted=True) def get_model(self): return Memo def prepare_facet_model_name(self

How to create a faceted line-graph using ggplot?

元气小坏坏 提交于 2019-12-05 09:34:32
问题 I have a data frame created with this code: require(reshape2) foo <- data.frame( abs( cbind(rnorm(3),rnorm(3, mean=.8),rnorm(3, mean=.9),rnorm(3, mean=1)))) qux <- data.frame( abs( cbind(rnorm(3),rnorm(3, mean=.3),rnorm(3, mean=.4),rnorm(1, mean=2)))) bar <- data.frame( abs( cbind(rnorm(3,mean=.4),rnorm(3, mean=.3),rnorm(3, mean=.9),rnorm(3, mean=1)))) colnames(foo) <- c("w","x","y","z") colnames(qux) <- c("w","x","y","z") colnames(bar) <- c("w","x","y","z") rownames(foo) <- c("n","q","r")

solr geography hierarchy

老子叫甜甜 提交于 2019-12-05 02:24:41
问题 I've been trying to figure out a way to implement faceting with hierarchies in solr and can't figure out how to do it in my situation. I've read a couple of the articles on doing hierarchies in solr along with the solutions in patch 64 and 792. The main issue I'm having is that I have entities that can belong to multiple branches of the hierarchy. The current form of my data is a user document with MVAs for country, state, and city. Take for instance a geographical hierarchy that people can