similar to: qplot fill and colour not working as expected

Displaying 20 results from an estimated 1000 matches similar to: "qplot fill and colour not working as expected"

2011 Jul 12
4
qplot and for loops
I have 4 columns and 56 rows of made up data that I want to plot as a series of bar graphs. The idea is to create one bar graph for each of the 4 columns using a for loop. I tried the following command in RStudio and when I type x in the console I get just the 4th graph instead of all four graphs. I did not define what x is before hand. I was not sure what it would be. Any suggestions on how you
2011 Jun 23
3
trying to import xls or xlsx files
library(xlsReadWrite) mydata<-read.xls("file path", header=TRUE) however if I change xls to csv it works just fine. Any ideas what I'm doing wrong? I have have also using the package gdata with the exact same error. Below is the error that pops up. Error in findPerl(verbose = verbose) : perl executable not found. Use perl= argument to specify the correct path. Error in
2011 Jun 21
2
qplot/ggplot2 Questions
I took some data from an online poll about which R GUI people used most and I am messing around with it to learn how to use qplot. Specifically I am making a horizontal bar graph and I have two questions. 1. The categories are ordered in rather strange way at least to me. It is not alphabetical or ascending/descending order of votes cast so i had to manually state the order I wanted which is
2012 Jul 20
6
Speeding up a loop
General problem: I have 20 projects that can be invested in and I need to decide which combinations meet a certain set of standards. The total possible combinations comes out to 2^20. However I know for a fact that the number of projects must be greater than 5 and less than 13. So far the the code below is the best I can come up with for iteratively creating a set to check against my set of
2012 Oct 12
3
Autofilling a large matrix in R
I wish to create a matrix of all possible percentages with two decimal place percision. I then want each row to sum to 100%. I started with the code below with the intent to then subset the data based on the row sum. This works great for 2 or 3 columns, but if I try 4 or more columns the number of rows become to large. I would like to find a way to break it down into some kind of for loop, so
2012 Sep 07
4
Trying to learn how to write a function... can't define a variable??
I am just starting to experiment with writing a function and have run into what seems like a limitation or more likely a lack of understanding on my part. Very Simple Example: I want to define a function that does 1+1=2. z<-1 ADD<-function(x) { x<-x+1 } ADD(z) z output for z is 1 not the expected 2. Now if I were to do print(x+1) instead of x<-x+1 it does return 2, so the
2012 Sep 26
3
Removing duplicates without a for loop
I have several thousand rows of shipment data imported into R as a data frame, with two columns of particular interest, col 1 is the entry date, and col 2 is the tracking number (colname is REQ.NR). Tracking numbers should be unique but on occassion aren't because they get entered more than once. This creates two or more rows of with the same tracking number but different dates. I wrote a for
2009 Jun 11
2
Expand a contingency table based on the value in one column
Hi R-helpers, I have the following (dummy) dataframe: > test DATE LOCATION KIND CLASS COUNT 1 1 1 CAR A 2 2 1 1 TRUCK D 3 3 1 1 BUS E 4 4 1 2 CAR E 2 5 1 2 TRUCK A 7 6 1 2 BUS F 1 That I would like to turn into this: > test2 DATE LOCATION KIND CLASS 1 1 1
2009 Jan 26
1
reshape problem: id and variable names not being recognized
Hi everyone. Long time listener, first-time caller here. I have a data set that's been melted with the excellent reshape package, but I can't seem to cast it the way I need to. Here's the melted data's structure: > str(mdat) 'data.frame': 6978 obs. of 4 variables: $ VehType : Factor w/ 2 levels "Car","Truck": 1 1 2 1 1 2 1 1 1 1 ... $ Year :
2006 Jun 01
1
find not working properly
here is the input view [code] <form method="post" action="found"> <br> <b>Find by</b><br/> <b>Vehicle Number:</b><br/> <input id="truck_vehicleID" name="truck[vehicleID]" size="20" type="number" value=""/><br/> </p> <%= link_to "Find", :action
2012 Jul 23
2
Bug in my code (finding nonzero min)
Can someone verify for me if the for loop below is really calculating the nonzero min for each row of a matrix? I have a bug somewhere in the is section of code. My first guess is how I am find the the nonzero min of each row of my matrix. The overall idea is to make sure I am investing all of my money, i.e. new.set is a set of indicator variables for each stock for a particular portfolio, i.e.
2010 Dec 09
1
displaying a note or comment when --format doc
I''m new to rspec, so, I might be coloring outside the lines, but, there have been several instances where I have wanted to display a comment or note. for example: describe "truck" do it "should require model" do end end rspec spec --format doc truck should require model What I mean by display a comment or note would be like: truck NOTE: blah, blah,
2011 Aug 11
1
help with loops
hi I need help with list object. I have a list object > a <- c('apple','orange','grape') > b <- c('car','truck','jeep') > c <- list(a,b) > names(c) <- c('fruit','vehicle') > c $fruit [1] "apple" "orange" "grape" $vehicle [1] "car" "truck"
2009 Jun 22
4
SAS-like method of recoding variables?
Dear R-helpers, I am helping a SAS user run some analyses in R that she cannot do in SAS and she is complaining about R's peculiar (to her!) way of recoding variables. In particular, she is wondering if there is an R package that allows this kind of SAS recoding: IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2); Thanks for any help or suggestions you might be able
2009 May 26
3
Still can't find missing data
I'm trying to prepare some cross tabs, looking at a number of variables against a variable "connector" which has 2 values: "OD Passenger" and " Connector". When I produce a xtabs one way I have observations under "Connector" but against a different variable "Connector" shows all 0 values. What is wrong? I've looked into the na commands
2009 Feb 19
1
How do I get xtabs to show missing data?
I presume the behavior below (no Connector values in the second table) is because I have na values in my dataframe. How do I get them to list? I found references to na.action and na.pass, but I could not figure out how I could use them with xtabs to list the na as a value. I'm sure there's a simple syntax I need, but it's not obvious to me. > # Weighted Data
2009 Sep 25
1
if else and loop for code in R
I am using if else and loop to sortout the data set that is the values less than o or more than 100 will be chosen.I could not get outTable with loop. Please help me to correct the code: I USED: # Read a_data <- read.table("D:/SNP/copy.sas", header=T, sep="\t") tr <- a_data$truck ca <- a_data$cars length <- nrow(a_data) outTable <- matrix(nrow=length,ncol=3)
2008 Sep 23
2
how to model this
Dear list, I met with a business case and feel frustrated to model it,scenario is like this 1. logistics department running 2. a lot of customers place orders and goods need to be send to their site (nationwide) 3. order received and then choose from a list of truck carriers to deliver goods,a cheapest one should be selected but might not available for the limit of order-shipment time,so a more
2008 May 10
2
cannot locate cdrom
Im tryingn to run a cd from the windows 3.1 to '95 era. Its a Ford factory service manual disk for pulling up automotive diagnostics/schematics etc. The disk installed without a problem using wine /path/to/cdrom/install.exe . I can also run the locally installed executable file without a problem once again using wine /path/to/local.exe . The problem is that the program requires a callback to
2016 Nov 06
2
Asterisk 1.8 to Asterisk 13.11 appending area code to local numbers
Hello, I would like to add area code to local numbers, it worked like a charm on Asterisk 1.8 but does not work on Asterisk 13.11. Extensions.conf; worked before on Asterisk 1.8 ; Adding Area code to local numbers exten => _9XXXXXXX,n,Set(CALLERID(all)="$CallerID" <3818008000>) exten => _9XXXXXXX,n,Dial(SIP/voip-truck/1381${EXTEN:1},80) Any ideas? Thanks, Motty