[R] new line between '}' and 'else' in function body

2009-04-03 Thread Yihui Xie
Hi list members, ?else tells us In particular, you should not have a newline between '}' and 'else' to avoid a syntax error in entering a 'if ... else' construct at the keyboard or via 'source'. but there's no syntax error when you break the line between } and else in a function,

[R] extract tables as data.frames from HTML source

2009-04-03 Thread Yihui Xie
Hi, I wonder whether there is any convenient function (or package) to extract tables from a HTML page? e.g. from http://www.google.com/finance/historical?q=SHE:002251 I know we can readLines('URL'), gsub('td...', '...', source), ... and at last get the numbers; I'm writing to ask whether someone

Re: [R] new line between '}' and 'else' in function body

2009-04-03 Thread Romain Francois
Hi, That's because the parser knows how to deal with that stuff. However, when you type the same if/else at the command line, it will be parsed line by line, and the evaluator will not wait for the else to evaluate the if. Try to copy and paste your if/else to the command line. Romain

[R] Survey Package with Binary Data (no Standard Errors reported)

2009-04-03 Thread Paul Jones
Hi, I'm trying to get standard errors for some of the variables in my data frame. One of the questions on my survey is whether faculty coordinate across curriculum to include Arts Education as subject matter. All the responses are coded in zeros and ones obviously. For some of the other

[R] Intraday financial returns

2009-04-03 Thread Huth Nicolas
Hello,   I would like to create a function that computes intraday returns of a financial asset on a calendar time basis, without making any loop. For instance, I want to get price returns every 60 seconds. The main problem is that the times series of prices is irregularly spaced in time. I have

Re: [R] Add missing values/timestamps

2009-04-03 Thread j.k
Thanks a lot! The way with zoo worked perfect. Here is the code I've used finally: data.input01 -read.csv(./1_15min.txt, header = TRUE, sep = ;, quote=\, dec=,, fill = TRUE, comment.char=) data.input02 -read.csv(./2_15min.txt, header = TRUE, sep = ;, quote=\, dec=,, fill = TRUE, comment.char=)

Re: [R] extract tables as data.frames from HTML source

2009-04-03 Thread Dieter Menne
Yihui Xie wrote: I wonder whether there is any convenient function (or package) to extract tables from a HTML page? e.g. from http://www.google.com/finance/historical?q=SHE:002251 Try a search on R (I prefer markmail search) http://r-project.markmail.org/search/?q=extract%20html

Re: [R] how to sort and plot data?

2009-04-03 Thread Dieter Menne
Hem wrote: user_id website time 20google0930 21yahoo0935 20facebook1000 25facebook1015 61google0940 ... My problem is how to sort the data? So that, I can get information about one

Re: [R] finding best fitting model

2009-04-03 Thread Dieter Menne
Benedikt Niesterok wrote: Is there a function in r to find the best fitting model for a set of data? I would like to know if my data are related exponentially,linearly or if there is a logarithmic correlation between my x and y values. There is no one-stop method to do this. I would

[R] chaining consensus in cluster analyses

2009-04-03 Thread Penner, Johannes
Dear R-helpers, conducting different community ecology analyses my main aim is to find groupings in the data and geographical borders between communities and to prove them statistically. So after conducting a global test (Mantel) I am running a NMS and cluster analyses. These are followed by

Re: [R] how to sort and plot data?

2009-04-03 Thread Umesh Srinivasan
Hi, There is definitely a more elegant way of doing this which I don't know about (without a for loop), but try this: mat - matrix(NA, nrow = max(user_id), ncol = 2) mat[,1] - 1:max(user_id) # 1st column of matrix is the user ID for (i in 1:max(user_id)){ temp1 - subset(data, user_id = i) temp2

[R] DierckxSpline fitting with different sets of y-values in one time

2009-04-03 Thread Jonckers Elisabeth
Dear R users, I have a question about the Package DierckxSpline. I have tried to find the answer by myself but it didn't worked out. I wondered if Dierckxspline can use different sets of y values in one time to fit a line with knot. I have different sets of Y values representing the same

Re: [R] [R} seasonal differencing

2009-04-03 Thread Rau, Roland
Hi, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Joseph Magagnoli Sent: Thursday, April 02, 2009 5:36 PM To: r-help@r-project.org Subject: [R] [R} seasonal differencing Hi all, I was wondering how to construct a

Re: [R] new line between '}' and 'else' in function body

2009-04-03 Thread Yihui Xie
Thanks, Romain! So I think, for consistency, the following result deparse(parse(text = ' + f = function(x) { +if (x) { +1 +} # a new line here! +else { +2 +} + } + ') + ) [1] structure(expression(f = function(x) { if (x) { [3] 1

[R] Odp: finding best fitting model

2009-04-03 Thread Petr PIKAL
Hi I adopted an idea from Chemical Engineering where one guy used set of functions to check which can fit data well and used Excel for it. So I tried if I can do it in R. It is very rough and needs data to be a two column data frame with x in the first column together with list of formulas.

[R] Help pasting string as object name

2009-04-03 Thread Rob Denniker
I have a data frame containing monthly observations of the 'density' of each US state, recorded in variables named density.AL, density.AK, density.AZ, and so on for all 50 states. The data frame (called d) also contains a variable called Date which is encoded as a string in the format Jan-09,

[R] plyr and table question

2009-04-03 Thread baptiste auguie
Dear all, I'm puzzled by the following example inspired by a recent question on R-help, cc - textConnection(user_id website time 20google0930 21yahoo0935 20facebook1000 25facebook1015 61google

Re: [R] new line between '}' and 'else' in function body

2009-04-03 Thread Wacek Kusnierczyk
you can always wrap the whole if/else statement into innocent braces or parentheses, as in y = { if (x) 1 else 2 } y = ( if (x) 1 else 2 ) it doesn't have to be a function, and there is no need for the assignment either -- you just need to tell the parser

Re: [R] Help pasting string as object name

2009-04-03 Thread baptiste auguie
Hi, Is this what you want? d - data.frame(density.AL = seq(1, 10), density.AK = seq(1, 10), # many others... Date=letters[1:10]) # dummy example library(reshape) melt(subset(d, Date == b), id=Date) BTW, I spotted a few awkward things in your code, st - c(AL, AK)

Re: [R] Functions Accessing Databases

2009-04-03 Thread bartjoosen
Hi, There seems to be something wrong with your function getinfo. Try first to substitute your dbGetQuery by a print statement, so that you can see what is going on: getinfo=function(t){print(the SQL query)} allinfo=sapply(c(1985:2007),getinfo) If these results look good, you can change your

[R] course in ecological data analysis

2009-04-03 Thread Capelle, Jacob
Dear all, For my PhD study I'm looking for relevant courses/workshops (short term) in ecological data anlysis with R in Europe. After 2 days searching I'm convinced that google is probably not the right medium to find this information. If anyone can help me I will be most grateful. Best regards

[R] factorise variables in a data.frame

2009-04-03 Thread baptiste auguie
Dear list, I often need to convert several variables from numeric or integer into factors (before plotting, for instance), as in the following example, d - data.frame( x = seq(1, 10), y = seq(1, 10), z = rnorm(10), a = letters[1:10]) d2 - within(d,

Re: [R] extract tables as data.frames from HTML source

2009-04-03 Thread Gabor Grothendieck
If the question is specific to getting stock data from google finance then check out getSymbols.google in the quantmod package. Also note that there exists an r-sig-finance list for questions pertaining to R and finance. On Fri, Apr 3, 2009 at 2:18 AM, Yihui Xie xieyi...@gmail.com wrote: Hi,

[R] Trouble extracting graphic results from a bootstrap

2009-04-03 Thread Anders Bjorn
Hi, I'm trying to extract a histogram over the results from a bootstrap. However I keep receiving the error message Error in hist.default(boot.lrtest$ll, breaks = scott) : 'x' must be numeric. The bootstrap I'm running looks like: boot.test - function(data, indeces, maxit=20) { + y1 -

Re: [R] factorise variables in a data.frame

2009-04-03 Thread Wacek Kusnierczyk
baptiste auguie wrote: Dear list, I often need to convert several variables from numeric or integer into factors (before plotting, for instance), as in the following example, d - data.frame( x = seq(1, 10), y = seq(1, 10), z = rnorm(10), a = letters[1:10]) d2 -

[R] Schoenfeld Residuals

2009-04-03 Thread Laura Bonnett
Dear All, Sorry to bother you again. I have a model: coxfita=coxph(Surv(rem.Remtime/365,rem.Rcens)~all.sex,data=nearma) and I'm trying to do a plot of Schoenfeld residuals using the code: plot(cox.zph(coxfita)) abline(h=0,lty=3) The error message I get is: Error in plot.window(...) : need

Re: [R] factorise variables in a data.frame

2009-04-03 Thread baptiste auguie
Excellent! I felt it was fairly trivial but i can be quite dense on Friday mornings. I really like the generalisation. Many thanks, baptiste On 3 Apr 2009, at 12:11, Wacek Kusnierczyk wrote: baptiste auguie wrote: Dear list, I often need to convert several variables from numeric or

[R] Curve fitting,FDA for biological data

2009-04-03 Thread Triantafyllos Gkikopoulos
Dear all, Another newbie just got attracted to this mailing list. I am a biologist currently working my way through R, had sort play around with python earlier this year. I have some data exhibiting periodicity ** my data consists of peaks and valleys, with peaks arising due to the presence

Re: [R] plyr and table question

2009-04-03 Thread hadley wickham
On Fri, Apr 3, 2009 at 4:43 AM, baptiste auguie ba...@exeter.ac.uk wrote: Dear all, I'm puzzled by the following example inspired by a recent question on R-help, cc - textConnection(user_id  website          time 20        google            0930 21        yahoo            0935 20        

Re: [R] Schoenfeld Residuals

2009-04-03 Thread David Winsemius
I am not sure that ties are the only reason. If I create a few ties in the ovarian dataset that Therneau and Lumley provide, all I get are some warnings: ovarian[4:5, 1] - mean(ovarian[4:5, 1]) ovarian[6:8, 1] - mean(ovarian[6:8, 1]) fit - coxph( Surv(futime, fustat) ~ age + rx, ovarian)

Re: [R] Geometric Brownian Motion Process with Jumps

2009-04-03 Thread John-Paul Taylor
Hi, I have been using maxLik to do some MLE of Geometric Brownian Motion Process and everything has been going fine, but know I have tried to do it with jumps. I have create a vector of jumps and then added this into my log-likelihood equation, know I am getting a message: NA in the

[R] Linear model, finding the slope

2009-04-03 Thread Melissa2k9
Hi for some data I working on I am merely plotting time against temperature for a variable named filmclip. So for example, I have volunteers who watched various film clips and have used infared camera to monitor the temperature on their face at every second of the clip. The variable names I

[R] Titles on lattice colorkey

2009-04-03 Thread r-help . 20 . trevva
Dear R-ers, I'm not sure if this is a missing feature, a support request, or stupidity on my part, but nevertheless, its a question. Is it possible to add titles to colorkey legends? As far as I can tell, there is a command to do it for normal key legends, but not for colorkeys. eg it works

Re: [R] plyr and table question

2009-04-03 Thread ts8
baptiste auguie-2 wrote: ddply(d, .(website), transform, count = table(user_id)) # why two new columns? Try this to see why: as.data.frame(table(d$user_id)) This works more like you expect: ddply(d, .(website), transform, count = unclass(table(user_id))) - Tom -- View this

[R] how to do this the R way

2009-04-03 Thread onyourmark
Hi. I am sure there is a better way in R to do this then using a loop but I am new to it and not sure what to do. I think it might be something about using a function as an argument but not sure. I have a 1 x 2000 vector TS2 which has entries from the set {x: x is in Z and 0x8} (where Z is the

Re: [R] plyr and table question

2009-04-03 Thread hadley wickham
On Fri, Apr 3, 2009 at 8:43 AM, baptiste auguie ba...@exeter.ac.uk wrote: That makes sense, so I can do something like, count - function(x){        as.integer(unclass(table(x))) } count(d$user_id) ddply(d, .(user_id), transform, count = count(user_id))  user_id  website time count 1    

Re: [R] Linear model, finding the slope

2009-04-03 Thread Uwe Ligges
Melissa2k9 wrote: Hi for some data I working on I am merely plotting time against temperature for a variable named filmclip. So for example, I have volunteers who watched various film clips and have used infared camera to monitor the temperature on their face at every second of the clip.

[R] Convert factor to double?

2009-04-03 Thread p . silva
Hi! I'm reading a tab-seperated CVS file with: test1 - read.table(data.txt, header=TRUE) It's in the following format: Date_Time qK qL vL vP ... 0 30 22 110 88 ... ... (BTW: It seems to me R shifts the column descriptions by one.) Anyway, I would like to Fourier-transform one column.

Re: [R] plyr and table question

2009-04-03 Thread baptiste auguie
That makes sense, so I can do something like, count - function(x){ as.integer(unclass(table(x))) } count(d$user_id) ddply(d, .(user_id), transform, count = count(user_id)) user_id website time count 1 20 google 930 2 2 20 facebook 1000 2 3 21yahoo

Re: [R] lme between-group and within-group covariance

2009-04-03 Thread MUHC-Research
I will try to make this more precise. In the lme() function, the correlation argument allows the user to specify a within-group correlation structure, i.e. the structure of the Lambda matrix using the mixed model notation in Pineiro and Bates. What I want to do is specify a distinct structure for

Re: [R] Plotting multiple ablines

2009-04-03 Thread Thomas Levine
I've really been on a roll this week; the formula for the lines that I presented was completely wrong. But I'm glad I learned about mapply. I used this: mapply(abline, (converge$kY + tan((90-converge$kT) * pi / 180)*(-converge$kX)), tan((90-converge$kT) * pi / 180)) Tom! On Thu, Apr 2,

Re: [R] plyr and table question

2009-04-03 Thread baptiste auguie
of course! Thanks, baptiste On 3 Apr 2009, at 14:48, hadley wickham wrote: On Fri, Apr 3, 2009 at 8:43 AM, baptiste auguie ba...@exeter.ac.uk wrote: That makes sense, so I can do something like, count - function(x){ as.integer(unclass(table(x))) } count(d$user_id) ddply(d,

Re: [R] Schoenfeld Residuals

2009-04-03 Thread Laura Bonnett
Thank you for your comments. I have about 200 out of 2000 tied data points which makes the situation more complicated! I'll have at look at the book section you referred to. With regards to making the ylim finite, I'm not sure how I can go about that given that I don't understand why it isn't

Re: [R] Geometric Brownian Motion Process with Jumps

2009-04-03 Thread Ravi Varadhan
Hi, The error message is clear in that the gradient cannot be evaluated at your starting value for the parameters. Is your likelihood a smooth function of parameters? If so, then provide a different starting value. If it is not smooth, then you may have to use a method that does not depend

[R] [R-pkgs] New R graphics package targeting HTML 5 canvas element

2009-04-03 Thread Jeffrey Horner
Hi, canvas is a new R package implementing a graphics device that emits javascript code conforming to the HTML 5 CanvasRenderingContext2D interface. Available on CRAN soon, but you can get it here immediately: http://www.rforge.net/canvas If you have access to a beta web browser like

Re: [R] Geometric Brownian Motion Process with Jumps

2009-04-03 Thread Ravi Varadhan
Hi, The error message is clear in that the gradient cannot be evaluated at your starting value for the parameters. Is your likelihood a smooth function of parameters? If so, then provide a different starting value. If it is not smooth, then you may have to use a method that does not depend

Re: [R] Convert factor to double?

2009-04-03 Thread Uwe Ligges
p.si...@gmx.net wrote: Hi! I'm reading a tab-seperated CVS file with: test1 - read.table(data.txt, header=TRUE) It's in the following format: Date_Time qK qL vL vP ... 0 30 22 110 88 ... ... (BTW: It seems to me R shifts the column descriptions by one.) No, look into your data

[R] (no subject)

2009-04-03 Thread dirk567
Dear R users, I am trying to do exact matching on a large dataset (500.000 obs), about equal size of treatment and controll group, with replacement: As for the moment I use the Match function of the Matching library. I match on 2 covariates and all observations in the treatment group have at

Re: [R] how to do this the R way

2009-04-03 Thread Uwe Ligges
onyourmark wrote: Hi. I am sure there is a better way in R to do this then using a loop but I am new to it and not sure what to do. I think it might be something about using a function as an argument but not sure. I have a 1 x 2000 vector TS2 which has entries from the set {x: x is in Z and

Re: [R] for loop for extracting linear model info

2009-04-03 Thread Uwe Ligges
Melissa2k9 wrote: Hi, I have written a for loop as such: model-lm(Normalised~Frame,data=All,subset=((Subject==1)(Filmclip==Strand))) summary(model) ### #To extract just the Adjusted R squared ###

Re: [R] course in ecological data analysis

2009-04-03 Thread milton ruser
Try r-sig-ecol...@r-project.org bests miltinho brazil-toronto On Fri, Apr 3, 2009 at 6:27 AM, Capelle, Jacob jacob.cape...@wur.nl wrote: Dear all, For my PhD study I'm looking for relevant courses/workshops (short term) in ecological data anlysis with R in Europe. After 2 days searching

[R] embed?

2009-04-03 Thread rkevinburton
I have a question on the function 'embed'. I ran the example x - 1:10 embed(x, dimension=3) This gives the output: [,1] [,2] [,3] [1,]321 [2,]432 [3,]543 [4,]654 [5,]765 [6,]876 [7,]987 [8,] 1098

Re: [R] DierckxSpline fitting with different sets of y-values in one time

2009-04-03 Thread spencerg
Dear Elisabeth: Have you tried it? I have not, but I suspect the answer is no. What problem are you trying to solve? You might get more useful suggestions from this list if you provide commented, minimal, self-contained, reproducible code describing your problem and what you've

Re: [R] embed?

2009-04-03 Thread Gabor Grothendieck
Its lets you perform rolling summaries using apply: apply(embed(1:10, 3), 1, mean) [1] 2 3 4 5 6 7 8 9 Note that 2 is the mean of 1:3, 3 is the mean of 2:4, ..., 9 is the mean of 8:10. On Fri, Apr 3, 2009 at 11:04 AM, rkevinbur...@charter.net wrote: I have a question on the function 'embed'.

Re: [R] embed?

2009-04-03 Thread Ravi Varadhan
Kevin, The documentation is quite clear. What embedding does is that it takes a scalar time series, x[t], and embeds it in a higher-dimensional space of dimension, dimension. The entries in the matrix you see are the indices of the time-series. So, for example, if dimension = 2, you embed

Re: [R] course in ecological data analysis

2009-04-03 Thread Robert A LaBudde
At 05:27 AM 4/3/2009, Capelle, Jacob wrote: Dear all, For my PhD study I'm looking for relevant courses/workshops (short term) in ecological data anlysis with R in Europe. After 2 days searching I'm convinced that google is probably not the right medium to find this information. If anyone can

Re: [R] Curve fitting,FDA for biological data

2009-04-03 Thread trias
Here is the gif that didn't come through earlier http://www.nabble.com/file/p22870832/signal.gif signal.gif -- View this message in context: http://www.nabble.com/Curve-fitting%2CFDA-for-biological-data-tp22868069p22870832.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] embed?

2009-04-03 Thread Wacek Kusnierczyk
rkevinbur...@charter.net wrote: I have a question on the function 'embed'. I ran the example x - 1:10 embed(x, dimension=3) This gives the output: [,1] [,2] [,3] [1,]321 [2,]432 [3,]543 [4,]654 [5,]765 [6,]87

Re: [R] Curve fitting,FDA for biological data

2009-04-03 Thread stephen sefick
What is your end goal? If it is to try and account for the variability of the timeseries you may want to look at ?spectrum If it is to model the periodicity... Stephen Sefick On Fri, Apr 3, 2009 at 11:30 AM, trias t.gkikopou...@dundee.ac.uk wrote: Here is the gif that didn't come through

Re: [R] embed?

2009-04-03 Thread markleeds
Hi kevin: one use ( there are probably many others ) is for use inside a vector autoregression model where the RHS is lags of the independent variable. So, x_t is the 3rd column, x_t-1 is the second, x_t-2 is the third etc. On Apr 3, 2009, rkevinbur...@charter.net wrote: I

Re: [R] Help pasting string as object name

2009-04-03 Thread Rob Denniker
What a very useful package! Thanks for pointing out its existence. Sadly ?melt is basically useless, but I did find the following quasi-vignette by the author of the reshape package to be quite useful. http://www.jstatsoft.org/v21/i12/paper Cheers. -Original Message- From:

Re: [R] Fit unequal variance model in R

2009-04-03 Thread Dieter Menne
Feng Jingyu wrote: I used gls and it still does not provide me different estimates of variance for each treatment group. Did I do anything wrong? lm3-gls(GSI~treatment,data=z,weights=varIdent(form=~treatment),method=ML) try weights = varIdent(form~1|treatment) See the example in

Re: [R] Constrined dependent optimization.

2009-04-03 Thread rkevinburton
I have decided to use this SANN approach to my problem but to keep the run time reasonable instead of 20,000 variables I will randomly sample this space to get the number of variables under 100. But I want to do this a number of times. Is there someone who could help me set up WINBUGS to repeat

[R] Conversions From standard to metric units

2009-04-03 Thread stephen sefick
I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often a need to convert from standard units to metric units. Is there a package in R for this already? If not I believe that I am going to write some of the most often

Re: [R] Trouble extracting graphic results from a bootstrap

2009-04-03 Thread David Winsemius
On Apr 3, 2009, at 7:10 AM, Anders Bjorn wrote: Hi, I'm trying to extract a histogram over the results from a bootstrap. However I keep receiving the error message Error in hist.default(boot.lrtest $ll, breaks = scott) : 'x' must be numeric. The bootstrap I'm running looks like:

Re: [R] Updating a data frame

2009-04-03 Thread Seeliger . Curt
To my earlier question about updating a dataframe, and certainty that this has been solved several times before, Dr. Winsemius suggests (Thanks!): I am sure this is not the most elegant method, but it will work. new - merge(nn,uu, by = c(a,b), all.x=T) new$y - with( new,

Re: [R] Conversions From standard to metric units

2009-04-03 Thread Duncan Murdoch
stephen sefick wrote: I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often a need to convert from standard units to metric units. Is there a package in R for this already? If not I believe that I am going to write

[R] Removing backslashes from data

2009-04-03 Thread Andrew Conway
I am trying to check for backslashes in data, then remove them when I find them, but am having a difficult time figuring out the best way to do it. I know the backslash is the escape character in R, and I should be able to use 'gsub' to accomplish this, but I all I seem to be getting are

Re: [R] Fit unequal variance model in R

2009-04-03 Thread Dieter Menne
Feng Jingyu wrote: Thanks a lot. The problem is solved. It took me a while to understand the output from the R. With little calculation, I am able to match results from R to SAS. To conserve you sanity, don't try it. They will be different. Dieter -- View this message in context:

Re: [R] Conversions From standard to metric units

2009-04-03 Thread baptiste auguie
I had a similar need for conversions in optics. I put together several functions and data on r-forge, where it does not clutter CRAN but can still be shared conveniently with others. baptiste On 3 Apr 2009, at 19:27, Duncan Murdoch wrote: stephen sefick wrote: I am starting to use R

[R] data.frame to array?

2009-04-03 Thread rkevinburton
I have a list of data.frames str(bins) List of 19217 $ 100026:'data.frame': 1 obs. of 6 variables: ..$ Sku : chr 100026 ..$ Bin : chr T149C ..$ Count: int 108 ..$ X: int 20 ..$ Y: int 149 ..$ Z: chr 3 $ 100030:'data.frame': 1 obs. of 6 variables: ... As you can

[R] Working with and without formula in function

2009-04-03 Thread dogle
I am attempting to write a function that is flexible enough to respond to the user providing a formula (with a data= argument) or not (similar to plot(x,y) versus plot(y~x,data=data)). I have found a method to work with this in a simple case but am having trouble determining how to find a

[R] dendrogram rect.hclust() not working?

2009-04-03 Thread Alex Reynolds
I have tried to use rect.hclust() to draw a rectangle around a set of leaves, but am running into trouble. The rect.hclust() is drawing two rects instead of one, and of the wrong size: scoreClusterObj - hclust(scoreDistanceObj, method=clustMethod) order -

Re: [R] Removing backslashes from data

2009-04-03 Thread markleeds
Below works but it has two backslashes in the word. maybe someone can explain why the 4 and 2 works but 2 1 doesn't ? thanks. gsub(,,Hello\\World,perl=TRUE) On Apr 3, 2009, Andrew Conway agc...@nyu.edu wrote: I am trying to check for backslashes in data, then remove them

Re: [R] Removing backslashes from data

2009-04-03 Thread Duncan Murdoch
On 4/3/2009 2:33 PM, Andrew Conway wrote: I am trying to check for backslashes in data, then remove them when I find them, but am having a difficult time figuring out the best way to do it. I know the backslash is the escape character in R, and I should be able to use 'gsub' to accomplish

Re: [R] Fit unequal variance model in R

2009-04-03 Thread Dieter Menne
Feng Jingyu wrote: Hi For my purpose, I need to match variance estimates for each group from R and SAS. They do match now. Consider yourself a lucky man! Dieter -- View this message in context: http://www.nabble.com/Fit-unequal-variance-model-in-R-tp22829549p22874048.html Sent from

[R] R. A. Fisher Test for value of periodorgam

2009-04-03 Thread Peterko
Is there in some pacakage this test? i mean that input will be only the value of periodogram, and the function will say that are significant. or is there only the way to calcule Fishers statistics W =Vi/V1 + · · · + Vm, for i =1 m and test it step by step ? thanks -- View this message in

[R] Weighted principal components analysis?

2009-04-03 Thread Alan Cohen
Hello R-ers, I'm trying to do a weighted principal components analysis. I couldn't find any such option with princomp or prcomp. Does anyone know of a package or way to do this? More specifically, the observations I'm working with are averages from populations of varying sizes. I thus need

Re: [R] data.frame to array?

2009-04-03 Thread Gavin Simpson
On Fri, 2009-04-03 at 11:45 -0700, rkevinbur...@charter.net wrote: I have a list of data.frames str(bins) List of 19217 $ 100026:'data.frame': 1 obs. of 6 variables: ..$ Sku : chr 100026 ..$ Bin : chr T149C ..$ Count: int 108 ..$ X: int 20 ..$ Y: int 149

[R] compute effect sizes (partial eta)

2009-04-03 Thread Martin Batholdy
hi, is there a function that calculates and prints out the partial etas of every independent variable in a linear model? thanks for any help! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] data.frame to array?

2009-04-03 Thread David Winsemius
I do not think that the form [[1:3]] is legit. ltest - list( a, b, c, d) ltest[[1:3]] Error in ltest[[1:3]] : recursive indexing failed at level 2 You might try with single brackets: ltest[1:3] [[1]] [1] a [[2]] [1] b [[3]] [1] c -- David Winsemius On Apr 3, 2009, at 2:45 PM,

Re: [R] data.frame to array?

2009-04-03 Thread hadley wickham
On Fri, Apr 3, 2009 at 1:45 PM, rkevinbur...@charter.net wrote: I have a list of data.frames str(bins) List of 19217  $ 100026:'data.frame': 1 obs. of  6 variables:  ..$ Sku  : chr 100026  ..$ Bin  : chr T149C  ..$ Count: int 108  ..$ X    : int 20  ..$ Y    : int 149  ..$ Z    : chr

[R] US county map question

2009-04-03 Thread Smith, Phil (CDC/CCID/NCIRD)
Hi R-help: I'm just an old guy and new to this list... But have been using R for years now. I want to make a map of counties in the US with shaded colors that depend on the level of variable Y that I want to map. I have the US county and state fips codes and the Y variable. How do I do this?

Re: [R] data.frame to array?

2009-04-03 Thread Wacek Kusnierczyk
David Winsemius wrote: I do not think that the form [[1:3]] is legit. sure it is. ltest - list( a, b, c, d) ltest[[1:3]] Error in ltest[[1:3]] : recursive indexing failed at level 2 read the error message: *recursive* indexing failed. that's because ltest[[1]] has only one element

[R] Discriminant Analysis - Obtaining Classification Functions

2009-04-03 Thread Pavel Kúr
Hello! I need some help with the linear discriminant analysis in R. I have some plant samples (divided into several groups) on which I measured a few quantitative characteristics. Now, I need to infer some classification rules usable for identifying new samples. I have used the function lda from

[R] Changing the y-axis units of a lattice histogram

2009-04-03 Thread Judith Flores
Hello, I need to multiply the number of counts in the y-axis of a lattice histogram by a constant factor, such that the plot would represent a different type of variable plotted in the y-axis, not counts. Can this be done? Thank you, Judith __

Re: [R] Changing the y-axis units of a lattice histogram

2009-04-03 Thread Sundar Dorai-Raj
Try: library(lattice) histogram( ~ height | voice.part, data = singer, type = c, scales = list(y = list(at = seq(0, 20, 5), labels = seq(0, 200, 50 HTH, --sundar On Fri, Apr 3, 2009 at 2:01 PM, Judith Flores jur...@yahoo.com wrote: Hello,

[R] Multiple use of par()

2009-04-03 Thread Hesen Peng
Hi all, I created a plot function which used par(mfcol=c(2,1)) so that I could have two plots together using just one command. For exampe: plot.foo - function(data){ par(mfcol=c(2,1)) hist(data) plot(data) } Later I wanted to show 4 of these foo objects in the same picture. So I used

Re: [R] Weighted principal components analysis?

2009-04-03 Thread Stéphane Dray
see the row.w argument of the function dudi.pca in the ade4 package. Cheers. Alan Cohen wrote: Hello R-ers, I'm trying to do a weighted principal components analysis. I couldn't find any such option with princomp or prcomp. Does anyone know of a package or way to do this? More

Re: [R] Linear model, finding the slope

2009-04-03 Thread Charles Annis, P.E.
I'm not sure what you are doing when you Normalize. Would you explain? To see if the slope is significant, look at the model summary, in your example: summary(model) Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265

Re: [R] Discriminant Analysis - Obtaining Classification Functions

2009-04-03 Thread Emmanuel Charpentier
reauire(MASS) ; ?predict.lda should enlighten you. Glancing at VR4 might be a bit more illuminating... HTH Emmanuel Charpentier Le vendredi 03 avril 2009 à 22:29 +0200, Pavel Kúr a écrit : Hello! I need some help with the linear discriminant analysis

[R] [OT ?] rant (was : Re: Conversions From standard to metric units)

2009-04-03 Thread Emmanuel Charpentier
Le vendredi 03 avril 2009 à 14:17 -0400, stephen sefick a écrit : I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often a need to convert from standard units to metric units. rant US/Imperial units are *not*

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metric units)

2009-04-03 Thread Rolf Turner
On 4/04/2009, at 10:37 AM, Emmanuel Charpentier wrote: Le vendredi 03 avril 2009 à 14:17 -0400, stephen sefick a écrit : I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often a need to convert from standard

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metric units)

2009-04-03 Thread Duncan Murdoch
On 03/04/2009 5:37 PM, Emmanuel Charpentier wrote: Le vendredi 03 avril 2009 à 14:17 -0400, stephen sefick a écrit : I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often a need to convert from standard units to

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metricunits)

2009-04-03 Thread Murray Cooper
For science yes. For pleasure I'll still take a pint instead of 570ml! Murray - Original Message - From: Rolf Turner r.tur...@auckland.ac.nz To: Emmanuel Charpentier charp...@bacbuc.dyndns.org Cc: r-h...@stat.math.ethz.ch Sent: Friday, April 03, 2009 6:18 PM Subject: Re: [R] [OT ?]

[R] error in trmesh (alphahull package)

2009-04-03 Thread Murray Richardson
Hello R community, I have cross-posted with r-sig-geo as this issue could fall under either interest group I believe. I just came accross the alphahull package and am very pleased I may not need to use CGAL anymore for this purpose. However, I am having a problem computing alpha shapes

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metricunits)

2009-04-03 Thread Berwin A Turlach
G'day Murray, On Fri, 3 Apr 2009 20:01:30 -0400 Murray Cooper myrm...@earthlink.net wrote: For science yes. For pleasure I'll still take a pint instead of 570ml! And you might experience a disappointment then if you order it in the US where the pint is apparently 450ml; at least, I won several