[R] 3D Plot of Convex hull

2013-11-18 Thread wwreith
I have a data set in which I am trying to plot a convex hull in 3 dim. Below is a subset of the points I would use. Columns 2,3,4 are my x,y,z coordinates. I found some ways to plot 2D convext hulls or find a convex hull for higher dimensions, but not how to plot the data. I have have attached

[R] R packages for CAT scans

2013-09-18 Thread wwreith
Does anyone know of a package that would allow data from a CT scan to be loaded into R? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/R-packages-for-CAT-scans-tp4676418.html Sent from the R help mailing list archive at Nabble.com.

[R] readTiff - Sorry can't handle images with 32-bit samples

2013-07-26 Thread wwreith
I tried using readTiff() and got the error message Sorry can't handle images with 32-bit samples line of code x - readTiff(C:/Users/550062/Desktop/Data/example1.tif) So far I have not had any luck finding this error message on google. Any guess at what it means and how to get the code to work?

[R] Autofilling a large matrix in R

2012-10-12 Thread wwreith
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

[R] Removing duplicates without a for loop

2012-09-26 Thread wwreith
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.

[R] Trying to learn how to write a function... can't define a variable??

2012-09-07 Thread wwreith
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

[R] Revolution Analytics

2012-09-04 Thread wwreith
Has anyone every used Revolution Analytics? It claims to be faster than R, but when I ran a for loop of linear regression that requires a couple of minutes to process in RStudio. Revolution Analytics has a run time that was exactly the same. I was just wondering if anyone has experience with the

Re: [R] Speeding up a loop

2012-07-23 Thread wwreith
1.15 60 0.553555415 0.574892872 1.15 60 0.563183983 0.564029359 Shouldn't the function row out the second one, since it it higher in position 3 and lower in position 4 i.e. it should not all be yes? -- View this message in context:

[R] Bug in my code (finding nonzero min)

2012-07-22 Thread wwreith
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

Re: [R] Speeding up a loop

2012-07-21 Thread wwreith
next for loop question. I need a loop that removes a row from a matrix if it is worse in positions 1,2,3,4 than another row in the matrix. right now my matrix is 503028x26. Rule to define worse position1 is smaller, position2 is smaller, position3 is higher, and position4 is smaller Example:

Re: [R] Speeding up a loop

2012-07-21 Thread wwreith
Any chance I could ask for an idiots guide for function to.keep(x). I understand how to use it but not what some of the lines are doing. Comments would be extremely helpful. -- View this message in context: http://r.789695.n4.nabble.com/Speeding-up-a-loop-tp4637201p4637316.html Sent from the R

[R] Speeding up a loop

2012-07-20 Thread wwreith
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

Re: [R] Speeding up a loop

2012-07-20 Thread wwreith
That is faster than what I was doing and reducing 15% of my iterations it still very helpful. Next question. I need to multiply each row x[i,] of the matrix x by another matrix A. Specifically for(i in 1:n) { If (x[i,]%*%A[,1].5 || x[i,]%*%A[,2]42 || x[i,]%*%A[,3]150) { x-x[-i,] n-n-1 }. #In

[R] Correct Interpretation of survreg() coeffs

2012-05-04 Thread wwreith
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.

[R] Creating a survival object with and without an event indicator

2012-05-03 Thread wwreith
When reading about surv(). I saw the following statement Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event. So I tried the following 1. survobj-surv(mydata$Time) vs. 2. survobj-surv(mydata$Time, mydata$Event) where mydata$Event is a

[R] How does survreg ordered factors vs not ordered factors?

2012-04-23 Thread wwreith
Consider the following generic code for a survival model survobj-Surv(data$Time,data$Satisfactory) survmodel-survreg(survobj~x1+x2+x3+x4+x5+x6, data=data, dist=weibull) survsum-summary(survmodel) survsum My question: Does anyone know what exactly survreg() does differently if x1-factor(data$x1,

Re: [R] Inverse matrix using eigendecomposition

2011-12-13 Thread wwreith
Sorry but I am not a student, at least not since 2007. However I am performing grunt work for a someone with a Ph.D. so it does remind me of the student days. I just have a pay check instead of student loans. -- View this message in context:

[R] hclust and ggplot2

2011-12-13 Thread wwreith
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

[R] Inverse matrix using eigendecomposition

2011-12-12 Thread wwreith
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

Re: [R] 3D Bar Graphs in ggplot2?

2011-08-03 Thread wwreith
So I take it 3D pie charts are out? P.S. It is not about hiding anything. It is about consulting and being told by your client to make 3D pie charts and change this font or that color to make the graphs more apealing. Given that I am the one trying to open the door to using R where I work it

[R] 3D Bar Graphs in ggplot2?

2011-08-02 Thread wwreith
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.

Re: [R] qplot and for loops

2011-07-13 Thread wwreith
I just wanted the post the results of the emails I been sending/getting. The following command will create the graphs and save them to the location of your choice. The names are graph1.png, graph2.png etc. for(i in 1:4) { png( file=paste(C:/Insert file location/graph,i,.png, sep=) )

[R] qplot and for loops

2011-07-12 Thread wwreith
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.

[R] XLConnect Error

2011-06-27 Thread wwreith
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

[R] trying to import xls or xlsx files

2011-06-23 Thread wwreith
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

[R] qplot/ggplot2 Questions

2011-06-21 Thread wwreith
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

[R] ggplot2 Histogram with density curve

2011-06-07 Thread wwreith
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),

[R] ggplot 2: Histogram with bell curve?

2011-06-07 Thread wwreith
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

[R] qplot fill and colour not working as expected

2011-06-06 Thread wwreith
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, car, car,

[R] MANOVA Post Hoc Testing Tukeys

2011-05-16 Thread wwreith
I used manova() with one predictor variable and four factor levels call them A, B, C, and D. There are 12 response variables. I now want to perform pairwise comparisons for A-B, A-C, etc. for all 12 response variables. If I were doing an ANOVA test I would run TukeyHSD() and be done. However

[R] histograms and for loops

2011-05-06 Thread wwreith
The following code works mostly. It runs fine but... 1. Is there a way to increment the xlab for each graph? I would like to have Graph 1, Graph 2, etc. Right now it just gives me Graph i over and over again. 2. Is there a way to get the x-axis and y-axis to be bold or at least a darker color?

[R] Storing data from a test as a vector or matrix

2011-05-04 Thread wwreith
I just finished a MANOVA test and got the following output: summary(M, test=Pillai) Df Pillai approx F num Df den DfPr(F) as.factor(X) 3 1.1922 6.5948 36360 2.2e-16 *** Residuals 129 --- Signif. codes: 0 '***'

Re: [R] Storing data from a test as a vector or matrix

2011-05-04 Thread wwreith
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 *** Residuals 129 6.1823 0.04793 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 . . . There are 11 more just

Re: [R] Storing data from a test as a vector or matrix

2011-05-04 Thread wwreith
I figured out that attributes is the command that I was trying to find. It allowed me to find out that I was needing to use stats not Df or Pillai etc. Following command worked. S1-as.vector(S$stats[1,]) However when I try the same thing with summary.aov it is not working. SA-summary.aov(M)

[R] Writing Macros for RExcel

2011-04-27 Thread wwreith
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

[R] Problems with normality req. for ANOVA

2010-08-02 Thread wwreith
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

Re: [R] Problems with normality req. for ANOVA

2010-08-02 Thread wwreith
(434)-989-7948 From: David Winsemius [via R] [ml-node+2310616-1859960724-371...@n4.nabble.com] Sent: Monday, August 02, 2010 1:33 PM To: Reith, William [USA] Subject: Re: Problems with normality req. for ANOVA On Aug 2, 2010, at 9:33 AM, wwreith wrote: I am