Re: [R] reshape data frame

2013-11-18 Thread tsippel
Thanks, that seems to work. On Fri, Nov 15, 2013 at 10:26 PM, arun kirshna [via R] < ml-node+s789695n4680556...@n4.nabble.com> wrote: > Hi, > > Try: > var1 <- load("reshape_data.frame.RData") > ##It is better not to name the objects with function names. > dat1 <- data > reshape1 <- reshape > na

[R] Distribution of cluster medoids

2012-03-30 Thread tsippel
When looking at the histogram distribution of medoids from a cluster analysis, clara{cluster}, they are close to normally distributed around zero. The cluster plot, clusplot{cluster}, does not suggest distinct partitions. How should the histogram distribution of medoids be interpreted? Can one s

[R] Extracting data from trellis object

2012-01-25 Thread tsippel
Simple question (I hope?). How does one extract the data from a trellis object? I need to get the data from a call to histogram(). A simple example below... dat<-data.frame(year=as.factor(round(runif(500, 1990, 2010))), x=rnorm(500, 75, 35), y=rep(seq(1,50,by=1), times=10)) histogram(d

[R] Reshaping and plotting tabular data

2011-04-14 Thread tsippel
Hi- Tabular data have been provided to me within .csv files. I need to transform the data from tabular format into a dataframe with three columns. The columns need to be the table row id, table column id, and the tabulated variable. An example dataset can be downloaded here: https://docs.google.co

[R] Kolmogorov-smirnov test

2011-02-18 Thread tsippel
Is the kolmogorov-smirnov test valid on both continuous and discrete data? I don't think so, and the example below helped me understand why. A suggestion on testing the discrete data would be appreciated. Thanks, a <- rnorm(1000, 10, 1);a # normal distribution a b <- rnorm(1000, 12, 1.5);b # no

[R] Help with nested loops

2009-04-14 Thread tsippel
Hello- I need to loop through a directory of files to extract data corresponding to dates in a dataframe. Within a function, I've written nested loops to index the dataframe dates, and the directory files. My function successfully extracts the data corresponding to my first data frame date, but

[R] Error in segmented() output from segmented package

2009-01-26 Thread tsippel
Hi- I'm gettting the following error message when trying to use the segmented function to look for breakpoints in my data. Error in segmented.glm(glm, seg.Z = ~segmentdist, psi = 2, control = seg.control(display = F), : (Some) estimated psi out of its range Here are some real data and the

[R] subset exact values

2009-01-22 Thread tsippel
Hi- I need to subset the following data by the column 'dal' for values that equal the regular interval seq(0, 150, by=0.5) exactly excluding rows with irregular 'dal' values such as c(2.888958, 2.891620), etc. data<-data.frame(id=id, dal=dal, date=date, mu.x=mu.x) $dal [1] 0.00 0.

[R] Alignment of image plot overlay

2009-01-08 Thread tsippel
I'm having trouble with alignment of a trend line overlayed onto an image plot. The two should be plotted on the same x-axis (time-series). However, the trend line begins about an inch into the image plot x-axis and ends about an inch off of end of the image plot. Once I have the alignment sort

Re: [R] Conditional operation on multiple columns from two data frames

2008-12-28 Thread tsippel
The suggestion below was made. df1$Date <- as.Date(df1$Date) df2$Date <- as.Date(df2$Date) ifelse(df1$ID==df2$ID & df1$Date-df2$Date<0.5,df1$y-df2$y, NA) However, because my dataframe rows do not align, I need the conditionals to be tested on every combination of cells. I'm starting to think