[R] Image analysis and image questions

2007-10-12 Thread Bio7
Dear R users, in my application i can transfer images to R with the help of Rserve. The images come from a java application. When i plot a greyscale image (values 0-255) with images (imageMatrix...as grey) the image is created with inverse colours. My first question is how can i plot the image wi

Re: [R] A read.table mystery (data for Filemaker Mac)

2007-10-12 Thread Emmanuel Charpentier
Mark Wardle a écrit : > 1. Which version of Filemaker? NB: Framemaker is a different program > (desktop publishing), so do be a little precise! Dunno. The file is named "export.fm7" ; one might be tempted to infer Filemaker 7. "Framemaker" is a typo > 2. If it is an ancient version, then I s

[R] I am away on 12 Oct pm.

2007-10-12 Thread Hwee Pin PHUA
I will be out of the office starting 12/10/2007 and will not return until 15/10/2007. Otherwise, I will reply to your email when I am back. Have a great day! Hwee Pin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] maps does not work

2007-10-12 Thread Lukas Gudmundsson
2007/10/11, Ray Brownrigg <[EMAIL PROTECTED]>: > On Thu, 11 Oct 2007, Lukas Gudmundsson wrote: > > Hello, > > I am trying to draw geographical maps with the maps package. However > > > > if I try to access the data following error occurs: > > > require(maps) > > > map() > > > > Fehler in zip.file.e

Re: [R] maps does not work

2007-10-12 Thread Prof Brian Ripley
I think the problem is that tempdir() has been set somewhere invalid. However, does help() work at all, since that uses the same mechanism? Here are some diagnostic hints: Start an R session, printout tempdir() and see if it looks right. Search for the directory on your file system and see if y

[R] random forest mtry and mse

2007-10-12 Thread David Rogowski
I have been using random forest on a data set with 226 sites and 36 explanatory variables (continuous and categorical). When I use "tune.randomforest" to determine the best value to use in "mtry" there is a fairly consistent and steady decrease in MSE, with the optimum of "mtry" usually equal t

Re: [R] accessing ylim set by xyplot

2007-10-12 Thread Duncan Mackay
At 22:48 12/10/07, you wrote: >Hello, > >I would like to know if there is a clever way to avoid the problem >illustrated below within the xyplot function. > >x <- seq(1:10) >y <- seq(1:10) >pr1 <- xyplot(x ~ y) > >u <- seq(1:12) >v <- seq(1:12) >pr2 <- xyplot(u ~ v, col = "red", more = FALSE) > >p

Re: [R] Anybody has ever met the problem to add a legend to a figure generated by image()

2007-10-12 Thread Katharine Mullen
have you tried the function image.plot in the package fields? On Fri, 12 Oct 2007, zhijie zhang wrote: > Dear friends, > Anybody has ever met the problem to add a legend to a figure generated by > image()? I have three variables,x,y and z. > x and y are the coordinates, and z is the third value

Re: [R] Operating matrix positions

2007-10-12 Thread Svempa
Still one problem remains. The list I have is a list where every element refers to a file, where the actual matrices are. This means problems with dealing with them. How do I turn the list of references into an actual vector with real matrices as components? See below for earlier details. Svemp

Re: [R] collapsing a data frame

2007-10-12 Thread jim holtman
Here is one way. Not sure what you wanted done with some of the other variables, so I just chose the first one; you could do max/min: > z <- by(h, h$BROOD, function(x){ + # take first value of elements you don't want to change + data.frame(BROOD=x$BROOD[1], TICKS.mean=mean(x$TICKS), TICKS

Re: [R] Basic plot question: Figure 1.1 Pinheiro & Bates

2007-10-12 Thread Douglas Bates
On 10/12/07, David Afshartous <[EMAIL PROTECTED]> wrote: > All, > Sorry for overly simplistic question, but I can't seem to remember how to > create the basic plot shown in Figure 1.1 of Pinheiro & Bates (2004; p.4). > The y-axis delineates a factor (Rail) while the x-axis displays the > distributi

Re: [R] Automating binning for chisq.test()

2007-10-12 Thread Marc Schwartz
On Fri, 2007-10-12 at 11:16 -0600, D. R. Evans wrote: > The standard chisq.test() and fisher.test() functions, when applied to > two distributions (to determine whether the same underlying > distribution applies to both) requires one to pre-bin the > distributions. > > Is there a library function

Re: [R] Automating binning for chisq.test()

2007-10-12 Thread Duncan Murdoch
On 10/12/2007 1:16 PM, D. R. Evans wrote: > The standard chisq.test() and fisher.test() functions, when applied to > two distributions (to determine whether the same underlying > distribution applies to both) requires one to pre-bin the > distributions. > > Is there a library function (either buil

[R] Utility data uploading functions prior to analysing data using CGIwithR

2007-10-12 Thread Chris Evans
Dear all, I am developing a small suite of cgi-bin programs on my server that help provide some things that statistical/psychometric beginners may find helpful and which are aren't widely available. Some early e.g.s are: http://www.psyctc.org/stats/R/multirater.html http://www.psyctc.org/stats/R

[R] Automating binning for chisq.test()

2007-10-12 Thread D. R. Evans
The standard chisq.test() and fisher.test() functions, when applied to two distributions (to determine whether the same underlying distribution applies to both) requires one to pre-bin the distributions. Is there a library function (either built-in or in a package) that acts more like the ks.test(

Re: [R] test for whether dataset comes from a known MVN

2007-10-12 Thread Ben Bolker
Desmond Campbell wrote: > > Dear Ben Bolker, > > Thanks for replying and offering advice, unfortunately it doesn't solve my > problem. > > 1) The mshapiro.test() in the mvnormtest package appears only applicable > for datasets containing 3-5000 samples, whereas my dataset contains > 100,000

[R] collapsing a data frame

2007-10-12 Thread Ben Bolker
Trying to find a quick/slick/easily interpretable way to collapse a data set. Suppose I have a data set that looks like this: h <- structure(list(INDEX = structure(1:6, .Label = c("1", "2", "3", "4", "5", "6"), class = "factor"), TICKS = c(0, 0, 0, 0, 0, 3 ), BROOD = structure(c(1L, 1L, 2L

[R] Batch-Plot Histograms

2007-10-12 Thread Thomas Schwander
Hi everyone, anybody’s got an idea why the following script doesn’t produce batch-histograms? I’m using Windows XP and R 2.5.1. Here’s the script: matrix<-read.csv("C:\\Stadtwerke_mit_Umlage.csv", header=TRUE,sep=";",dec=".") Stadtwerke<-colnames(matrix) Bereich_blau<-66.67

Re: [R] calculate impulse responses

2007-10-12 Thread sj
Perhaps the VAR and irf functions in the vars library will allow you to do what you want. good luck, spencer On 10/12/07, Martin Ivanov <[EMAIL PROTECTED]> wrote: > > Dear R users, > > I need perform structural analysis on a no intercept VAR model. > Unfortunately the functions irf.VAR and d

[R] calculate impulse responses

2007-10-12 Thread Martin Ivanov
Dear R users, I need perform structural analysis on a no intercept VAR model. Unfortunately the functions irf.VAR and dfev that come with the MSBVAR package only work with objects output by the reduced.form.var function, which seems to only evaluate VAR models with intercept. Is there a way to

[R] embedding plots

2007-10-12 Thread Josue G. Martinez
Hello! I am trying to embed a plot of a curve(say x^2) on a matrix that I am viewing using the image(matrix) command. I was wondering if someone could give me some idea of how to do this. Thanks, J. [[alternative HTML version deleted]] __ R-

Re: [R] Basic plot question: Figure 1.1 Pinheiro & Bates

2007-10-12 Thread Stefan Grosse
On Friday 12 October 2007 17:31:22 David Afshartous wrote: DA > All, DA > Sorry for overly simplistic question, but I can't seem to remember how to DA > create the basic plot shown in Figure 1.1 of Pinheiro & Bates (2004; p.4). DA > The y-axis delineates a factor (Rail) while the x-axis display

[R] Disregard my previous question

2007-10-12 Thread Leeds, Mark (IED)
I did ?par and it looks switching to mfrow will fix my problem so thanks but disregard my previous message and I apologize for not checking ?par first. I never thought it would be that simple. This is not an offer (or solicitation of an off

Re: [R] Anybody has ever met the problem to add a legend to a figure generated by image()

2007-10-12 Thread hadley wickham
On 10/12/07, Bert Gunter <[EMAIL PROTECTED]> wrote: > ?levelplot() is the standard lattice package version of image and > automatically generates a legend. > > Note: if the image is expressed as a matrix, X, of nrow x ncol values, then > (as in image()) then levelplot should be invoked with: > > r

[R] hist () x-axis

2007-10-12 Thread Birgit Lemcke
Hello all together, I (R Beginner) think the answer for my question is easy but anyway I have not found the solution. I am using hist for a frequency histogramm. But the divisions of the xaxis is to large How can I change the division (I am not sure if this is the right name for what I mea

Re: [R] Anybody has ever met the problem to add a legend to a figure generated by image()

2007-10-12 Thread Bert Gunter
?levelplot() is the standard lattice package version of image and automatically generates a legend. Note: if the image is expressed as a matrix, X, of nrow x ncol values, then (as in image()) then levelplot should be invoked with: rowindx <- seq.int(nrow(X)) levelplot(t(X)[,rev(rowindx)],scales=

[R] Problem with two libraries

2007-10-12 Thread Michael Kubovy
Hi, I'm running > sessionInfo() R version 2.6.0 (2007-10-03) i386-apple-darwin8.10.1 locale: en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base I have two libraries: (1) /Users/mk/R/i386-ap

Re: [R] Batch-Plot Histograms

2007-10-12 Thread jim holtman
why don't you just output to postscript instead of using dev.copy: postscript("yourfile.ps") ...your script.. dev.off() On 10/12/07, Thomas Schwander <[EMAIL PROTECTED]> wrote: > Hi everyone, > > > > anybody's got an idea why the following script doesn't produce > batch-histograms? > > I

Re: [R] how to know whether Vector B is a subset of Vector A

2007-10-12 Thread Marc Schwartz
On Fri, 2007-10-12 at 18:47 +0800, Samuel wrote: > Hi, > > I'm quite fresh to R, and a layman of English as well. I hope I can make you > understood. > > Now I have two vectors A and B. Is there any quick way to know whether B is > a subset of A? and If B is a subset of A, can I know easily which

Re: [R] how to know whether Vector B is a subset of Vector A

2007-10-12 Thread Peter Dalgaard
Samuel wrote: > Hi, > > I'm quite fresh to R, and a layman of English as well. I hope I can make you > understood. > > Now I have two vectors A and B. Is there any quick way to know whether B is > a subset of A? and If B is a subset of A, can I know easily which elements > in A (the index of A) equ

[R] Anybody has ever met the problem to add a legend to a figure generated by image()?

2007-10-12 Thread zhijie zhang
Dear friends, Anybody has ever met the problem to add a legend to a figure generated by image()? I have three variables,x,y and z. x and y are the coordinates, and z is the third values. we can use image(x, y, z,...) to generate a figure according to the z-values, but the problem is the figure le

Re: [R] maps does not work

2007-10-12 Thread Lukas Gudmundsson
Hello, I found a working but not satisfactory solution. I did compare the file structures of "maps" and "mapdata" and found that the \data subdirectories of both packages have one main difference: maps\data contains a Rdata.zip file with some xxx.r and yyy.rda files. mapdata\data does not contain

[R] change of variance components depending on scaling of fixed effects

2007-10-12 Thread Arild Husby
Dear all, I am trying to understand the output from a binomial lmer object and why the scaling of a fixed effect changes the variance components. In the model p2rec is cbind(number recruits2,number recruits 1), Pop is populations (five level factor) and ja is year (covariate running from 1955-

Re: [R] how to generate and evaluate a design using Algdesign

2007-10-12 Thread S Ellison
If you do something like length(coef(lm(y~.+v3:v4 + v5:v6, data=dat))) to get a quick empirical estimate of required number of coefficients, you will find that you have 35 coefficients, so 32 observations cannot provide a solution at all. And indeed, nTrials=35 is the first size at which optFederov

[R] Q-type factor analysis

2007-10-12 Thread Julia Kröpfl
Hallo! Is there a package in R that does Q-type factor analysis? I know how to do principal component analysis, but haven't found any application of Q-type factor analysis. Thx, Julia -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kanns mit allen: http://www.gmx.net/de/go/multimesse

[R] irfs from a no intercept VAR

2007-10-12 Thread Martin Ivanov
Dear R users, I need perform structural analysis on a no intercept VAR model. Unfortunately the functions irf.VAR and dfev that come with the MSBVAR package only work with objects output by the reduced.form.var function, which seems to only evaluate VAR models with intercept. Is there a way to

Re: [R] Plotting question

2007-10-12 Thread Eric Thompson
Try par(mar=c(3,4,2,2), mfrow=c(5,2)) On 10/12/07, Leeds, Mark (IED) <[EMAIL PROTECTED]> wrote: > I am constructing plots ( regular not lattice ) and my initial command > is > > par(mar=c(3,4,2,2), mfcol=c(5,2)) > > and then I create 10 plots on the page. It looks great but the plots on > the pa

[R] Basic plot question: Figure 1.1 Pinheiro & Bates

2007-10-12 Thread David Afshartous
All, Sorry for overly simplistic question, but I can't seem to remember how to create the basic plot shown in Figure 1.1 of Pinheiro & Bates (2004; p.4). The y-axis delineates a factor (Rail) while the x-axis displays the distribution of a continuous variable (time) according to each level of the f

Re: [R] accessing ylim set by xyplot

2007-10-12 Thread Peter Dalgaard
Powell, Jeff wrote: > Hello, > > I would like to know if there is a clever way to avoid the problem > illustrated below within the xyplot function. > > x <- seq(1:10) > y <- seq(1:10) > pr1 <- xyplot(x ~ y) > > u <- seq(1:12) > v <- seq(1:12) > pr2 <- xyplot(u ~ v, col = "red", more = FALSE) >

[R] how to know whether Vector B is a subset of Vector A

2007-10-12 Thread Samuel
Hi, I'm quite fresh to R, and a layman of English as well. I hope I can make you understood. Now I have two vectors A and B. Is there any quick way to know whether B is a subset of A? and If B is a subset of A, can I know easily which elements in A (the index of A) equals to B's elements accordin

Re: [R] random forest mtry and mse

2007-10-12 Thread Kuhn, Max
Dave, > I have been using random forest on a data set with 226 sites and 36 > explanatory variables (continuous and categorical). When I use > "tune.randomforest" to determine the best value to use in "mtry" there > is a fairly consistent and steady decrease in MSE, with the optimum of > "mtry

[R] accessing ylim set by xyplot

2007-10-12 Thread Powell, Jeff
Hello, I would like to know if there is a clever way to avoid the problem illustrated below within the xyplot function. x <- seq(1:10) y <- seq(1:10) pr1 <- xyplot(x ~ y) u <- seq(1:12) v <- seq(1:12) pr2 <- xyplot(u ~ v, col = "red", more = FALSE) prts <- list(pr1, pr2) for(i in prts) pr

[R] Differencing data by groups

2007-10-12 Thread Thomas Miller
Colleagues, I am analyzing data collected during oceanographic cruises. We have conducted many cruises over the last decade. On each cruise we visit ~50 stations. At each station (termed EventNum)we lower an instrument that measures depth, temperature, salinity and oxygen every few seconds as it

[R] Plotting question

2007-10-12 Thread Leeds, Mark (IED)
I am constructing plots ( regular not lattice ) and my initial command is par(mar=c(3,4,2,2), mfcol=c(5,2)) and then I create 10 plots on the page. It looks great but the plots on the page go in the order 16 27 38 49 510 Where the numbers denote decile breakdowns. Is there

Re: [R] Plotting question

2007-10-12 Thread hadley wickham
Have you looked at layout() ? Hadley On 10/12/07, Leeds, Mark (IED) <[EMAIL PROTECTED]> wrote: > I am constructing plots ( regular not lattice ) and my initial command > is > > par(mar=c(3,4,2,2), mfcol=c(5,2)) > > and then I create 10 plots on the page. It looks great but the plots on > the page

Re: [R] variance explained by each term in a GAM

2007-10-12 Thread Julian Burgos
Dear Prof. Wood, Just another quick question. I am doing model selection following Wood and Augustin (2002). One of the criteria for retaining a term is to see if removing it causes an increase in the GCV score. When doing this, do I also need to fix the smooth parameters? Thanks, Julian B

Re: [R] wireframe shade=T colorkey

2007-10-12 Thread Duncan Murdoch
On 10/11/2007 6:32 PM, Deepayan Sarkar wrote: > On 10/11/07, Karim Rahim <[EMAIL PROTECTED]> wrote: >> Thank you for your reply. >> >> In this graphics context, I'm not sure what the incident or reflected >> light rays are. >> >> May I ask for an example of using a colour key with the volcano data

[R] similarity measure for two different clusters

2007-10-12 Thread Julia Kröpfl
Hey there! I would like to justify the stability of the cluster of a subset of my data by comparing it to another cluster of another subset. Does there exist a quantitative similarity measure that can be applied? I am open for any suggestions, thx for your help, Julia -- _

Re: [R] wireframe shade=T colorkey

2007-10-12 Thread Deepayan Sarkar
On 10/12/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 10/11/2007 6:32 PM, Deepayan Sarkar wrote: > > On 10/11/07, Karim Rahim <[EMAIL PROTECTED]> wrote: > >> Thank you for your reply. > >> > >> In this graphics context, I'm not sure what the incident or reflected > >> light rays are. > >> > >

Re: [R] constraining correlations

2007-10-12 Thread Matthew Keller
Hi all, I want to constrain observed correlations to be equal. E.g., I want to find the ML cor(x,y) and cor (w,z) given that cor(x,y) must be equal to cor(w,z). I've received some suggestions that were sent directly to me, but based on these responses, I'm afraid I wasn't clear enough in my orig

Re: [R] collapsing a data frame

2007-10-12 Thread Chris Stubben
> On 10/12/07, Ben Bolker ufl.edu> wrote: > > > > Trying to find a quick/slick/easily interpretable way to > > collapse a data set. > > Another alternative for SQL fans is the sqldf package. I used the MySQL driver here since SQLite does not support standard deviation. sqldf("select BROOD,

Re: [R] Q-type factor analysis

2007-10-12 Thread Kenn Konstabel
On 10/12/07, "Julia Kröpfl" <[EMAIL PROTECTED]> wrote: > > Is there a package in R that does Q-type factor analysis? > I know how to do principal component analysis, but haven't found any > application of Q-type factor analysis. Q-mode factor analysis is not a separate "type" of factor analysis b

[R] Addition operation based on specific columns and rows of two data frames

2007-10-12 Thread Luke Neraas
#Hello, # I have a question about the addition of values in specific columns and rows of a Data frame. # Below I have created two data frames, X.df and "Y.df". ## creation of X.df data frame X<- matrix(0,16,3) X.df<-data.frame(X) X.df[,1] <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) X.df[,2] <- c(1,2,3

Re: [R] Addition operation based on specific columns and rows of twodata frames

2007-10-12 Thread Leeds, Mark (IED)
My guess is that there's an easier way but this gives what you want. newY.df<-aggregate(Y.df$Counts, list(Y.df[,1],Y.df[,2]), FUN=sum) names(newY.df)<-names(X.df) temp.df<-merge(newY.df, X.df, by=intersect(names(X.df),names(newY.df)),all=TRUE) almost.df<-aggregate(temp.df$Counts, list(temp.df[

Re: [R] hist () x-axis

2007-10-12 Thread Gavin Simpson
On Fri, 2007-10-12 at 17:41 +0200, Birgit Lemcke wrote: > Hello all together, > > I (R Beginner) think the answer for my question is easy but anyway I > have not found the solution. > > I am using hist for a frequency histogramm. But the divisions of the > xaxis is to large > > How can I cha

[R] use 'lapply' to creat 2 new columns based on old ones in a data frame

2007-10-12 Thread runner
There is a dataset 'm', which has 3 columns: 'index', 'old1' and 'old2'; I want to create 2 new columns: 'new1' and 'new2' on this condition: if 'index'==i, then 'new1'='old1'+add[i]. 'add' is a vector of numbers to be added to old columns, e.g. add=c(10,20,30 ...) Like this: index old1

Re: [R] use 'lapply' to creat 2 new columns based on old ones in a data frame

2007-10-12 Thread Sundar Dorai-Raj
runner said the following on 10/12/2007 4:46 PM: > There is a dataset 'm', which has 3 columns: 'index', 'old1' and 'old2'; > > I want to create 2 new columns: 'new1' and 'new2' on this condition: > if 'index'==i, then 'new1'='old1'+add[i]. > 'add' is a vector of numbers to be added to old colu

[R] Plotting with 2 y axes

2007-10-12 Thread Keith Cox
My data is the following: Time Resistance Temperature 5 2000 4 10 2200 8 15 2500 14 20 2900 20 25 3000 29 30 3100 38 35 3500 46 40 3800 47 45 3900 50 50 4000 51 I would like to create a scatter plot with Time on the x axis, Resistance on the y axis

Re: [R] Plotting with 2 y axes

2007-10-12 Thread jim holtman
basically something along these lines: plot(Time, Resistance, bty='c') par(new=TRUE) plot(Time, Temperature, axes=FALSE, ylab='', xlab='') axis(4) On 10/12/07, Keith Cox <[EMAIL PROTECTED]> wrote: > My data is the following: > > > > > Time > > Resistance > > Temperature > > > 5 > > 2000 > > 4 > >

Re: [R] Differencing data by groups

2007-10-12 Thread jim holtman
What problem are you actually having with 'diff'? Now if you are using 'diff', you will get a vector that is shorter by one than the original. Now do you want to do do something like: Xbar = Sum{c(Depth[1], diff(Depth))*temp}/Sum(c(Depth[1], diff(Depth)) On 10/12/07, Thomas Miller <[EMAIL PROTE

[R] TLCA Admin Email Connectivity Re: Returned mail: Data format error

2007-10-12 Thread TLCA Admin
Due to an intermittent Broadband connection, I cannot check email as often as I'd like. Please be assured that all your emails are being received & I will respond to those that require attention as my ISP Connection allows. CIncinnati Bell cannot advise as to when this will be fixed, so I ask that

Re: [R] collapsing a data frame

2007-10-12 Thread hadley wickham
On 10/12/07, Ben Bolker <[EMAIL PROTECTED]> wrote: > >Trying to find a quick/slick/easily interpretable way to > collapse a data set. > > Suppose I have a data set that looks like this: > > h <- structure(list(INDEX = structure(1:6, .Label = c("1", "2", "3", > "4", "5", "6"), class = "factor"

Re: [R] collapsing a data frame

2007-10-12 Thread hadley wickham
> > Here's a solution that takes the first element of each factor > > and the mean of each numeric variable. I can imagine there > > are more general/flexible solutions. (One might want to > > specify more than one summary function, or specify that > > factors that vary within group should be d

Re: [R] Image analysis and image questions

2007-10-12 Thread Henrik Bengtsson
See the EBImage package on Bioconductor.org. It builds on top of ImageMagick. /Henrik On 10/12/07, Bio7 <[EMAIL PROTECTED]> wrote: > > Dear R users, > > in my application i can transfer images to R with the help of Rserve. The > images come from > a java application. When i plot a greyscale imag

[R] How to identify the two largest peaks in a trimodal distribution

2007-10-12 Thread Rob Knell
Hello all I'm trying to do a simulation that involves identifying the minimum point between two peaks of a (usually) bimodal distribution. I can do this easily if there are only two peaks: CnBdens<-density(Ys/Xs) #probability density function for ratio of Ys to Xs for(p in