similar to: by() subset by factor gives unexpected results

Displaying 20 results from an estimated 20000 matches similar to: "by() subset by factor gives unexpected results"

2017 Aug 05
0
by() subset by factor gives unexpected results
The answer was (thanks to Mark Leeds) to do with the use of a factor instead of a vector. on [2017-08-05] at 08:57 Myles English writes: > I am having trouble understanding how the 'by' function works. Using > this bit of code: > > i <- data.frame(x=c(1,2,3), y=c(0,0,0), B=c("red","blue","blue")) > j <- data.frame(x=c(1,2,3),
2007 Sep 11
6
xyplot question
I have the code below and it works fine if I print the xyplot but if I take the print out, then I just get a blank pdf. The same holds if I just send the plot to the console without the print ( I get nothing ). My question is whether this is always the case with xyplot or is there something wrong with my settings ? I am on linux ( redhat ) and using R.2.5.0. Thanks. load("stocks.dat")
2011 Mar 17
4
Help with plotting a line that is multicoloured based on levels of a factor
Hi All, I'm trying to plot data that is a time series of flows that are associated with a specific level, and I would like each level to represent a colour in a line plot. Here is some data that approximates what I'm using: date=c(1:300) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c("high","med","low"),100)) data=cbind.data.frame(date, flow, levels)
2010 Feb 02
1
Subset and point plot
OK, I need help plotting. I have column headings of Day, Wgt, Foodin, Rep, Grp and Tanks. Rep=c(1,2,3) and Tanks=c(a1,a2,a3,a4,a5,a6, c1,c2,c3,c4,c5,c6, h1,h2,h3,h4,h5,h6). I created a subset where I only would like Rep=2, and Tanks=c(a4,c4,h4) and would like to graph (points) of Wgt and Day. I would think that I only need 3 colors, but when I run with only 3, only 2 lines show up. When I add
2009 Jul 03
2
Two questions about the cloud function in the lattice package
Hi, I have two questions regarding the cloud function in the lattice package: 1) Is there a way to not print the surrounding frame (i.e. the square surrounding the entire plot)? 2) Is there a way to italicize the text displayed with the key argument? Some sample code: data(iris) cloud(Sepal.Length~Petal.Length*Petal.Width,data=iris, groups=Species,screen=list(z=20,x=-70),
2006 Nov 19
2
improving barplot output
Hello, I was hoping for some advice on improving a barplot. Below is the syntax I have used. I wanted to do two things differently How would I alter the syntax so that (a) the y-axis finishes at 25 and not 20, and (b) 'past ideation' and 'pastwk ideation' are coloured blue and 'past attempt' & 'past wk attempt' are coloured red ? I was also curious as to
2007 Nov 22
4
more outrageous plotting
Dear Contributors: I have the next matrix: "X" "Y" "Z" 1 2 526 2 5 723 3 10 110 4 7 1110 5 9 34 6 8 778 7 1 614 8 4 876 9 6 249 10 3 14 I want to order the matrix from bigest Z (1110) to lower Z (14). Then I want to asign a color scale vector from blue ( bigest Z) to orange
2009 Aug 12
5
Nominal variables in SVM?
Hi, The answers to my previous question about nominal variables has lead me to a more important question. What is the "best practice" way to feed nominal variable to an SVM. For example: color = ("red, "blue", "green") I could translate that into an index so I wind up with color= (1,2,3) But my concern is that the SVM will now think that the values are
2009 Dec 09
4
Need help/suggestions for DialPlan
I am revising our DialPlan strategy for our Asterisk system (1.4.2) and looking for some info on 'best practices' for this. Here's what I'm trying to do: I have an ACD menu that gives the caller the options as follows: - Press 1 for sales - Press 2 for support - Press 3 for customer service - Press 8 for a 'Dial by Name' list or enter the extension number at anytime
2010 Dec 08
1
on NMDS graphics
Hi, I have used Vegan to construct an NMDS ordination plot. I plotted sites of three forest types with the site number in it. My reviewer has asked me to use different symbols for each of the forest types. Can anyone send me how I can do this in R in simple steps. I have used the options like ordiplot, sel and pl syntaxes that are not working for the question that I asked for. Best, Sinu --
2006 Jul 28
1
arules package: using image() deliveres unexpected results
Dear Collegues, it seems like there is a problem with the image()-method in the package arules. Using an ordninary matrix works fine: image(matrix(rnorm(200), 10, 20), axes = FALSE, col=brewer.pal(9, "Blues") ) delivers an image with blue colors and no axes. Using an object of the class "associations" (arules package) does not work: image(items(ta.eclat), axes = FALSE,
2007 Oct 07
1
Arguments to "personalised" plot()
Hi Folks, I'm curious for an explanation of the following -- it's a matter of trying to understand how R parses it. I've written sundry little "helper" variants of functions, in particular plot(), to save repetitively typing the same options over and over again. For example: plotb <- function(x,...){plot(x,pch="+",col="blue",...)} This does exactly
2008 Jun 13
1
Switching the order of legend boxes in a lattice bar graph
I suspect there is a simple solution to this problem, but have been unable to find it. Below is some code that I have run to create 3 lattice graphs. I have been asked to change the legend so that the 'No' and dark blue are above "Y" and light blue in the legend to mirror the stacked bars in the graph which feature dark blue above light blue. I have tried changing the data
2010 Sep 03
3
define colors for groups in lattice xyplot
Dear all, Lattice provides automatic coloring for subgroups on each panel by the simple use of a groups statement. For an application I want to change these colors to a predifined set. This works well using a panel function in stead of the default as long as there are only points in the graphs. When I set type="b" things get messed up. Any idea why? I include sample code for
2005 Apr 27
3
caches_page questions
I''m attempting to use caches_page to speed up the loading of certain pages on my site, and have run into a couple questions: 1) The site has ''states'' (as in U.S. states), so I have a State model and a States controller. Going to http://sitename/states/ routes you to the States controller, ''index'' action. The States controller looks like so: class
2006 Nov 09
1
unsubscribe
Adam Mattina Networking & Systems Support Layer 8 Group, Inc. 585.442.8888 amattina@layer8group.com <mailto:amattina@layer8group.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061109/023a0a3e/attachment.htm
2004 Jun 07
1
filled.contour - color palette so z=0 ONLY is blue
I am trying to create a topographic map of an island - the filled.contour function works fine except i am experiencing difficulty trying to represent the sea properly. Basically I want the default colour blue for any instance where z=0, if I simply use the default topo.color I get shades of blue for z values up to 220 metres. Is there a way in which I can specify terrain.color for all values of
2007 Aug 10
1
Unexpected behavior in PBSmapping package
Using R 2.5.1 on Windows XP Professional, and PBSmapping package version 2.51, I have encountered some behavior which puzzles me. I am including the package's listed maintainer on this email but also seek the thoughts of the R-help community. I have a set of EventData, which I want to plot as points, and to color the points according to some criterion. It turns out that some of my
2010 Oct 28
2
scatterplot3d; scaling point symbols to depth of graph
Hi I'm trying to scale the point symbols on a 3d plot so that the ones at the front are larger than the ones at the back. I'm trying to give the image some perspective. Given this code... library(scatterplot3d) data=array(c(0,5,9), c(3,3)) scatterplot3d(data, pch=19, cex.symbols=10-data[,2], color=c("red","blue","black")); > data [,1] [,2] [,3]
2016 Feb 04
2
llc gives Segmentation fault at instruction selection [was Re: Instruction selection gives "LLVM ERROR: Cannot select"]
Hello, Tim, Thank you for your advice. Indeed, the problem with "LLVM ERROR: Cannot select" was a false predicate that should have been true. I solved the problem by simply making the C++ function implementing the TableGen predicate used in my store instruction (very similar to the selectIntAddrMSA predicate from the Mips back end) return true instead of false. But