search for: reith_william

Displaying 20 results from an estimated 21 matches for "reith_william".

2012 Jul 20
0
[External] Re: Speeding up a loop
"Reith, William [USA]" <reith_william@bah.com> wrote on 07/20/2012 09:52:02 AM: > Would this matrix eat up memory making the rest of my program > slower? Each x needs to be multiplied by a matrix and the results > checked against a set of thresholds. Doing them one at a time takes > at least 24 hours right now. &gt...
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 06
2
qplot fill and colour not working as expected
I am just learning to use qplot and can't get the fill/colour to work. Below is the R code for a scatter plot and bar graph. library(ggplot2) x<-c(1,2,3,4,5,6,7) y<-c(1,2,3,2,5,6,3) qplot(x,y, main="Scatter Plot Test", xlab="X Label Test", ylab="Y Label Test", colour="blue")z<-c("van", "van", "van",
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
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 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
2011 May 04
1
Str info. Thanks for helping
...tor() Or something like SA[["Response IPS1"]]["as.factor(WSD)",] ## to select the first row only, even maybe with unlist() Without a better REPRODUCIBLE example, I cannot tell more (maybe some others can, that's why I reply to the list) HTH, Ivan Le 4 mai 2011 ? 20:17, reith_william at bah.com a ?crit : > I am still waiting for this to get posted so I thought I would email it to you. > > SA gives the output: > > Response IPS1 : > Df Sum Sq Mean Sq F value Pr(>F) > as.factor(WSD) 3 3.3136 1.10455 23.047 5.19e-12 *** > Re...
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
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 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.
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
2010 Aug 02
1
Problems with normality req. for ANOVA
I am conducting an experiment with four independent variables each of which has three or more factor levels. The sample size is quite large i.e. several thousand. The dependent variable data does not pass a normality test but "visually" looks close to normal so is there a way to compute the affect this would have on the p-value for ANOVA or is there a way to perform an nonparametric test
2011 Jun 07
1
ggplot 2: Histogram with bell curve?
I am learning ggplot2 commands specifically qplot for the time being and I have figured out how to create histograms and normal density curves but I am not sure how to add a normal bell curve or other dist. as well on top of a histogram. Here are the two graphs that I created. ## Histogram t<-rnorm(500) w<-qplot(t, main="Normal Random Sample", fill=I("blue"),
2011 Dec 14
0
hclust and ggplot2
I saw an example online of taking hclust dendrogram and plotting it using ggplot2 and thought I would give it a try to see what it would look like. I get an error when trying to use ggplot; Error: ggplot2 doesn't know how to deal with data of class phylo. Regular plot works fine but I can't get ggplot2 to work. see code below.... rows=100 columns=100 #create matrix
2012 May 04
1
Correct Interpretation of survreg() coeffs
Am I correct in assuming that the output below essentially translates to "Males have a mean time that is significantly lower than Females"? Is this the correct way to interpret the fact that the coefficient is negative? Assume the variale sex is treated as a factor with Female =0 and Male=1. survmodel<-survreg(survobj~sex,data=data1, dist="weibull")
2011 Jun 07
1
ggplot2 Histogram with density curve
I am learning ggplot2 commands and I have figured out how to create histograms and density curves but I am not sure how to add a density curve on top of a histogram. Here are the two graphs that I created. ## Histogram t<-rnorm(500) w<-qplot(t, main="Normal Random Sample", fill=I("blue"), colour=I("black"), geom="histogram") w ##Density Curve
2011 Apr 27
2
Writing Macros for RExcel
I have columns of data in Excel 2007, A2:A196, B2:B196...ET2:ET196 that I would like to place into arrays in R. I have been trying to write a macro that would automatically create all of my arrays for me with a array names coming from the cells A1, B1, etc. I can manually create an array using RExcel<Put R Var< Array, but I don't want to manually create all 150 arrays this way. Thanks
2011 Aug 02
3
3D Bar Graphs in ggplot2?
Does anyone know how to create a 3D Bargraph using ggplot2/qplot. I don't mean 3D as in x,y,z coordinates. Just a 2D bar graph with a 3D shaped bard. See attached excel file for an example. Before anyone asks I know that 3D looking bars don't add anything except "prettiness". http://r.789695.n4.nabble.com/file/n3713305/Example.xlsx Example.xlsx -- View this message in
2011 Dec 13
2
Inverse matrix using eigendecomposition
General goal: Write R code to find the inverse matrix of an nxn positive definite symmetric matrix. Use solve() to verify your code works. Started with a 3x3 matrix example to build the code, but something dosen't seem to be working. I just don't know where I am going wrong. ##Example matrix I found online A<-c(4,1,-1,1,2,1,-1,1,2) m<-matrix(A,nrow=3,ncol=3) ##Caculate the eigen
2011 Jun 27
3
XLConnect Error
Any ideas of what is happening when I attempt to load XLConnect? I think I installed everything correctly. I posted what I get when I installed rJava as well as when I attempted to load rJava directly. Thanks in advance for any help you can give on this. library(XLConnect) Loading required package: XLConnectJars Loading required package: rJava Error : .onLoad failed in loadNamespace() for