Re: [R] selecting certain rows from data frame

2010-12-14 Thread steven mosher
Hi, Next time give folks code to produce a toy sample of your problem DF <-data.frame(ID=rep(1:5,each=3),Data=rnorm(15),Stuff=seq(1:15)) DF ID Data Stuff 1 1 2.0628225 1 2 1 0.6599165 2 3 1 0.5672595 3 4 2 -0.5308823 4 5 2 -0.5358471 5 6 2 -0.1414992

Re: [R] Discriminant Correspondence Analysis

2010-12-14 Thread Wayne Sawtell
Thank you all for the advice. I have looked through the Introduction to R pdf and got some pointers but when I try to implement them it does not work. If someone could clarify a couple of basic things, I would appreciate it. When I successfully read in my file, the prompt changed from > to +. The

Re: [R] ridge() function and coxph

2010-12-14 Thread Terry Therneau
I need to add a belated acknowledgement to my prior comments. Thomas Lumley has also been a significant contributer to the survival code. Until I moved my development from Splus to R he was the primary maintainer of the R code, he tightened up a lot of the C code to make sure it would work on mult

[R] selecting certain rows from data frame

2010-12-14 Thread Hrithik R
Hi, if I have a dataframe such that ID Time  Earn 1        1        10 1        2        50 1        3        68 2    1    40 2    2    78 24   88 3    1    50 3    2    60 3    3    98 4    1    33 4    2    48 44  

Re: [R] Significance Help

2010-12-14 Thread Michael Bedward
Hello Samaire, I don't know much about eyesight measurements (other than that my own would probably be 0.1, 0.2) but I'll attempt some suggestions... For objective (1) you will have to define what you mean by significantly different. If you had data on left/right values from a larger population t

Re: [R] frestimate functionality

2010-12-14 Thread stephen sefick
Have you done a google search, looked on CRAN, searched the archives, or looked at the task views? I can't be of any help, but maybe one of those places could be. HTH, Stephen On Tue, Dec 14, 2010 at 7:57 PM, Jason Rupert wrote: > By any chance is there an R package that may contain functionali

[R] How to apitalize leading letters & else of personal names?

2010-12-14 Thread RockO
Dear R world, Do you know about a function that would capitalize in the correct manner first and family names? I found in the cwhmisc only the CapLeading function, but it just does not do the job, taking care only to capitalize the first letter of a word. I am looking for a function that would r

[R] frestimate functionality

2010-12-14 Thread Jason Rupert
By any chance is there an R package that may contain functionality similar to the frestimate in Matlab/Simulink. Here is the URL for a description of the frestimate functionality: http://www.mathworks.com/help/toolbox/slcontrol/ug/frestimate.html Thank you again for any feedback. ___

[R] [R-pkgs] googleVis 0.2.2 - Using the Google Visualisation API with R

2010-12-14 Thread Markus Gesmann
Hi all, Version 0.2.2 of the googVis package has been released on CRAN and will be available from your local CRAN mirror in due course. googleVis provides an interface between R and the Google Visualisation API. The functions of the package allow users to visualise data stored in R with the Goo

Re: [R] Modifying values outside a function using "apply".

2010-12-14 Thread Henrique Dallazuanna
Try this: l <- sapply(c(4, 3, 2), q.1) aggregate(V3 ~ V1 + V2, as.data.frame(do.call(rbind, l)), mean) On Tue, Dec 14, 2010 at 9:19 PM, Worik R wrote: > I am sure this si a simple problem but the solution is evading me. > > I have a list of matrices all with the same number of columns but diffe

Re: [R] from table to matrix

2010-12-14 Thread JESSICA [via R]
Hi Jonathan,thanks a lot! Mine is windows operating system so I will try other ways . About your question, do you want to get a matrix like this: 0 1 2 3 ...1817393 5524385 0687 0 64 0 71 0 55 ...

Re: [R] from table to matrix

2010-12-14 Thread JESSICA [via R]
Thank you guys I learnt a lot . But when I tried to run the library(ecodist) function, R says there is no package called "ecodist". why? __ View message @ http://r.789695.n4.nabble.com/from-table-to-matrix-tp3087972p3088184.html

Re: [R] Installing R-packages in Windows

2010-12-14 Thread Erik Lukac
Hi Mike, Hi Uwe, thanks for your reply. The main thing is that we have mixed OSs. On the one hand we have Linux, on the other WinXP. I need the same version of packages and R on both systems. Otherwise I cant explain my colleagues why error messages are reproduceable on only one system. Instal

[R] Significance Help

2010-12-14 Thread Samaire Holden
I have a set of results where I have the eyesight power of both left and right eyes for each participant (e.g. 0.75, 0.5). Each participant then had to throw basketballs into a hoop and the number of successful throws was recorded. I would like to do two things: 1. Test whether the eyesight po

[R] Urgent help requested using survfit(individual=T):

2010-12-14 Thread Angel Russo
Hello: I would like to obtain probability of an event for one single patient as a function of time (from survfit.coxph) object, as I want to find what is the probability of an event say at 1 month and what is the probability of an event at 80 months and compare. So I tried the following but it fai

Re: [R] Multivariate binary response analysis

2010-12-14 Thread Emmanuel Charpentier
Dear Derek, dear list, A couple suggestions (and more) : 0) check that your problem can't be expressed in terms of what glmer() (lme4(a|b)? package(s)) can solve. I use this often, and am quite impressed with its abilities. 1) Why not modeling that directly in BUGS ? That might not be easy, wi

Re: [R] lattice fun: multiple themes in panels with spplot()

2010-12-14 Thread nbest937
I figured out how to toggle the legend for the second scenario, but now I have three different map sizes! trellis.par.set( peelTheme) plot( spplot( thumbDf, "pri", colorkey= list( space= "left")), split= c( 1, 1, 3, 1), more= TRUE) plot( spplot( thumbDf, "sec", co

Re: [R] survival: ridge log-likelihood workaround

2010-12-14 Thread Therneau, Terry M., Ph.D.
You ask some good questions. > I would like to clarify statistics that ridge coxph returns. Here is > my understanding and please correct me where I am wrong. > 1) In his paper Gray [JASA 1992] suggests a Wald-type statistics with > the formula for degree of freedom. The summary function for r

Re: [R] from table to matrix

2010-12-14 Thread jonathan
I actually got it to work now using levelplot, and I also worked out how to get the graph I wanted to display, I had to assign the graph to a reference and then print it -- yes, that simple! Now I just need to work out why my levelplot doesn't look quite right, even though the data is in there...

[R] survfit

2010-12-14 Thread Angel Russo
Hello R helpers: *My first message didn't pass trough filter so here it's again* I would like to obtain probability of an event for one single patient as a function of time (from survfit.coxph) object, as I want to find what is the probability of an event say at 1 month and what is the probabilit

[R] lattice fun: multiple themes in panels with spplot()

2010-12-14 Thread nbest937
I have some geospatial data where two layers are thematic and the third is a percentage, so the maps need to have different themes. thumbDf <- as( stack( thumb), "SpatialGridDataFrame") names(thum...@data) <- c("pri", "sec", "pct") thum...@data$pri <- factor(thum...@data$pri, levels=c(0:8), lab

Re: [R] Discriminant Correspondence Analysis

2010-12-14 Thread Peter Ehlers
Wayne, So far, no one has said the obvious: Please do work your way through (or at least skim) "An Introduction to R" which you'll find right there on your computer under Help/Manuals. Your questions indicate that you have not yet done so. Do it, it really will pay off. Peter Ehlers On 2010-12-

Re: [R] Installing R-packages in Windows

2010-12-14 Thread Mike Marchywka
> Date: Tue, 14 Dec 2010 23:48:20 +0100 > From: er...@phonetik.uni-muenchen.de > To: marchy...@hotmail.com > CC: r-help@r-project.org; lig...@statistik.tu-dortmund.de > > Hi Mike, Hi Uwe, > > thanks for your reply. > The main thing is that we have mixed

[R] Modifying values outside a function using "apply".

2010-12-14 Thread Worik R
I am sure this si a simple problem but the solution is evading me. I have a list of matrices all with the same number of columns but different number of rows. The first two columns label the row. The labels are allways the same for the same row numbers, just some matricies have more rows. For e

Re: [R] from table to matrix

2010-12-14 Thread jonathan
Maybe I can help here: In OS X at least you can open the R Package Installer from the Packages & Data menu, select a mirror, etc, then type ecodist into the search bar and then Install Selected... this will install the ecodist package on your machine. Not exactly sure how it would be done under

Re: [R] rpart - how to estimate the “meaningful” predictors for an outcome (in classification t rees)

2010-12-14 Thread Xiaogang Su
Hi, Tal, Here is a quick way of getting around. First create two responses via dummy variables y1 <- ifelse(y=="a", 1, 0) y2 <- ifelse(y=="b", 1, 0) and then built two separate tree models for y1 and y2 separately. Hope it helps. Xiaogang On Tue, Dec 14, 2010 at 8:33 AM, Tal Galili wrote: >

Re: [R] from table to matrix

2010-12-14 Thread jonathan
OK well I don't mean to "hijack" Jessica's thread with a tangent on graphics and plots, but I'm still having some trouble. I'm a total newbie here so if the correct etiquette would be for me to start a new thread at this point then please do advise me!! The code I'm now trying to run is: library

Re: [R] Use generalised additive model to plot curve

2010-12-14 Thread Gavin Simpson
On Tue, 2010-12-14 at 22:36 +, e-letter wrote: > Readers, > > I have been reading 'the r book' by Crawley and think that the > generalised additive model is appropriate for this problem. The > package 'gam' was installed using the command (as root) > > install.package("gam") > ... > library(g

Re: [R] Use generalised additive model to plot curve

2010-12-14 Thread Bill.Venables
Dear Lurker, If all you art trying to do is to plot something, isn't all you need something like the following? x <- c( 30, 50, 80, 90, 100) y <- c(160, 180, 250, 450, 300) sp <- spline(x, y, n = 500) plot(sp, type = "l", xlab = "x", ylab = "y", las = 1, main = "A Spline Interpolation")

Re: [R] from table to matrix

2010-12-14 Thread Carl Witthoft
For contour plots, some of the contour functions in graphics packages (lattice for one IIRC) are pretty good at understanding that columns in a matrix correspond to x,y, and z values already. There are many ways to do this in R. For very simple problems, this one is convenient:

[R] Use generalised additive model to plot curve

2010-12-14 Thread e-letter
Readers, I have been reading 'the r book' by Crawley and think that the generalised additive model is appropriate for this problem. The package 'gam' was installed using the command (as root) install.package("gam") ... library(gam) > library(gam) Loading required package: splines Loading require

Re: [R] peak detection

2010-12-14 Thread Carl Witthoft
THere's the peaks package which will do some peak detection, or 'peaks' in the simecol package. Or msc.peaks.find in caMassClass, I'm madly trying to remember what spectral package I found which has a tool similar to msextrema but returns a couple more useful lists describing the data and t

Re: [R] from table to matrix

2010-12-14 Thread Phil Spector
Jonathan - Same problem, same solution: Suppose your data frame is called df: thematrix = matrix(NA,max(df$x),max(df$y)) thematrix[as.matrix(df[,1:2])] = df[,3] - Phil Spector Statistical Computing Facility

Re: [R] from table to matrix

2010-12-14 Thread Sarah Goslee
There are many ways to do this in R. For very simple problems, this one is convenient: library(ecodist) newdata <- crosstab(mydata$x, mydata$y, mydata$z) For more complicated problems, reshape is very powerful. Sarah On Tue, Dec 14, 2010 at 5:13 PM, jonathan wrote: > > That's so weird, I just

Re: [R] from table to matrix

2010-12-14 Thread Greg Snow
If the goal is to produce a filled contour plot, then look at the levelplot function in the trellis package, it takes the data in the form that you already have it, no need to transform. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408

[R] GLM with different factors

2010-12-14 Thread Rafael Xavier de Camargo
Hi R-Helpers, I am stuck with my analysis. I wonder if anybody could have with this. My data set looks like: Squares Hours SppRichness Feeding_guild natprop 1 10 1 aq inverts 0.118697 2 25 2 aq inverts 0.605874 3 35 2 fish 0.61255 4 20 4 fish 0.764418 5 40 3 ins

Re: [R] survival: ridge log-likelihood workaround

2010-12-14 Thread Damjan Krstajic
I would like to clarify statistics that ridge coxph returns. Here is my understanding and please correct me where I am wrong. 1) In his paper Gray [JASA 1992] suggests a Wald-type statistics with the formula for degree of freedom. The summary function for ridge coxph returns the degree of free

Re: [R] from table to matrix

2010-12-14 Thread jonathan
That's so weird, I just signed up on here to ask exactly the same question! However, I think my issue is like Jessica's who says that her data is like that, not actually that... So the issue is not in generating that data on-the-fly but in transforming it from a data frame to a matrix. As a mor

Re: [R] Discriminant Correspondence Analysis

2010-12-14 Thread Mark Difford
Wayne, >> I don't know how to assign a name for the df, or what to put for "fac", >> and what is worse, >> I get an error message saying that the program cannot find the >> "discrimin.coa" command. Before you can use a package you have downloaded you need to "activate" it. There are different w

[R] defining contrasts in lm() - is there a simpler way?

2010-12-14 Thread Mark Heckmann
Dear R users, I am looking for a simple way to define a contrast in a linear model. I have a data frame with two factors (f1, f2) and a dependent y. x <- data.frame(y =rnorm(30), f1=gl(2, 15), f2=gl(3, 5, 30)) Now I want to specify the following contrast: "f1= 1 or 2 and f2=1" vs. "f1= 1 or

Re: [R] How to bind models into a list of models?

2010-12-14 Thread Mark Na
Many thanks Phil. This is perfect. I usually forget about lapply and try something more complicated. Your solution works really well. Best, Mark On Tue, Dec 14, 2010 at 3:45 PM, Phil Spector wrote: > Mark - >   I believe > >  lapply(dd,function(m)eval(parse(text=m))) > > will do what you want.

Re: [R] from table to matrix

2010-12-14 Thread Phil Spector
Here's one way: df = data.frame(Date=rep(LETTERS[1:3],each=3),TIME=rep(letters[1:3],3),Q=1:9) df Date TIME Q 1Aa 1 2Ab 2 3Ac 3 4Ba 4 5Bb 5 6Bc 6 7Ca 7 8Cb 8 9Cc 9 mat = matrix(0,3,3,dimnames=list(LETTERS[1:3],letters[1:3

Re: [R] How to bind models into a list of models?

2010-12-14 Thread Phil Spector
Mark - I believe lapply(dd,function(m)eval(parse(text=m))) will do what you want. - Phil Spector Statistical Computing Facility Department of Statistics

[R] from table to matrix

2010-12-14 Thread JESSICA
I have a table like this: Date TIME Q A a1 A b2 A c3 B a4 B b5 B c6 C a7 C b8 C c9 I want use R language to turn it to a matrix like : a b c A 1 2 3 B 4 5 6 C 7 8 9 I am new to R , anyone can help? Than

[R] 300 dpi and eps:

2010-12-14 Thread Aldi Kraja
Hi, I have a run of 5 graphs that I want to place them under the same page. Everything works fine to place them in a pdf file , or eps file, but when it comes to have a high quality of 300 dpi these graphs are not good. For example I open the eps file with Adobe Illustrator (AI) and it shows th

Re: [R] How to bind models into a list of models?

2010-12-14 Thread Jinyan Huang
Try step() ? On Tue, Dec 14, 2010 at 10:05 PM, Mark Na wrote: > Hi R-helpers, > > I have a character object called dd that has 32 elements each of which > is a model formula contained within quotation marks. Here's what it > looks like: > >> dd >  [1] "lm(y ~ 1,data=Cement)"                     "

[R] How to bind models into a list of models?

2010-12-14 Thread Mark Na
Hi R-helpers, I have a character object called dd that has 32 elements each of which is a model formula contained within quotation marks. Here's what it looks like: > dd [1] "lm(y ~ 1,data=Cement)" "lm(y ~ X,data=Cement)" "lm(y ~ X1,data=Cement)" [4] "lm(

Re: [R] How to left or right truncate a character string?

2010-12-14 Thread Phil Spector
Mark - Since regular expressions in R are just character strings, it's pretty easy to assemble a regular expression to delete leading or trailing characters. For example: delchars = function(str,n,lead=TRUE){ +dots = paste(rep('.',n),collapse='') +pat = if(lead)paste('^',dots,sep=''

Re: [R] Discriminant Correspondence Analysis

2010-12-14 Thread Bastiaan Bergman
Read files, if you're on windows remember to include the path like this: "C:\\Documents and Settings\\USER\\My Documents\\MyFile.csv" -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wayne Sawtell Sent: Tuesday, December 14, 2010 12:3

[R] Discriminant Correspondence Analysis

2010-12-14 Thread Wayne Sawtell
Hello everyone, I am totally new to the R program. I have had a look at some pdf documents that I downloaded and that explain how to do many things in R; however, I still cannot figure out how to do what I want to do, which is to perform Discriminant Correspondence Analysis on a rectangular matrix

Re: [R] How to left or right truncate a character string?

2010-12-14 Thread Henrique Dallazuanna
Try this: noquote("lm(y ~ X2 + X3 + X4)") To remove X characters: gsub("^.|.$", "", "lm(y ~ X2 + X3 + X4)") On Tue, Dec 14, 2010 at 6:27 PM, Mark Na wrote: > Hi R-helpers, > > I have a character string, for example: > > "lm(y ~ X2 + X3 + X4)" > > from which I would like to strip off the lead

[R] How to left or right truncate a character string?

2010-12-14 Thread Mark Na
Hi R-helpers, I have a character string, for example: "lm(y ~ X2 + X3 + X4)" from which I would like to strip off the leading and trailing quotation marks resulting in this: lm(y ~ X2 + X3 + X4) I have tried using gsub() but I can't figure out how to specify the quotation mark using a regular

[R] 300 dpi and eps:

2010-12-14 Thread Aldi Kraja
Hi, I have a run of 5 graphs that I want to place them under the same page. Everything works fine to place them in a pdf file , or eps file, but when it comes to have a high quality of 300 dpi these graphs are not good. For example I open the eps file with Adobe Illustrator (AI) and it shows th

Re: [R] colour-plot of point intensities?

2010-12-14 Thread Greg Snow
Look at the hexbin package (bioconductor). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Matthew Vernon > S

Re: [R] curve

2010-12-14 Thread Peter Ehlers
On 2010-12-14 08:43, Sarah Goslee wrote: You are most likely to get reasonable help if you provide at a minimum your OS, the version of R you're using, and the error message you get. And also if you send your replies to the R-help list, not just me. Sarah Sarah's code works perfectly well on

[R] colour-plot of point intensities?

2010-12-14 Thread Matthew Vernon
Hi, I've spent a while scrabbling around at this problem, to no avail. I'm sure there /should/ be a simple answer... I have a large (14 million rows) data set, with two columns. Each row contains the number of times an individual moved, and the distance that individual moved in total. I would lik

Re: [R] Question

2010-12-14 Thread Greg Snow
What about thoughtless un-nasty comments? I would suggest the original poster (and others thinking that they want to do normality testing) read the help page for SnowsPenultimateNormalityTest in the TeachingDemos package, which I think agrees mostly with what Bert wrote below (though it goes mo

Re: [R] Installing R-packages in Windows

2010-12-14 Thread Uwe Ligges
Or in short, type install.packages("car") within R. Note that you won't get new versions of car for the outdated version of R. Note also that your zip file might not fit to the R version you are using. Hence recommendation is to upgrade to R-2.12.0 patched (or 2.12.1 which will be release

Re: [R] Installing R-packages in Windows

2010-12-14 Thread Mike Marchywka
( hotmail just randomly decides not to prefix original text, my comments below) Date: Tue, 14 Dec 2010 17:36:11 +0100 From: er...@phonetik.uni-muenchen.de To: r-help@r-project.org Hi there, I have the following problem and I hope somebody mig

Re: [R] Question

2010-12-14 Thread Bert Gunter
... (in addition to the very useful suggestion to plot your data): (Sounds like a homework question... ?). Sigh. [mount soapbox] 1. "Data" never deviate from normality. They only provide provide evidence to challenge ("test" is the formal term) the assumption that the population from which t

Re: [R] survreg vs. aftreg (eha) - the relationship between fitted coefficients?

2010-12-14 Thread Göran Broström
On Fri, Dec 10, 2010 at 5:21 PM, Eleni Rapsomaniki wrote: > Dear R-users, > > I need to use the aftreg function in package 'eha' to estimate failure times > for left truncated survival data. Be careful! This is only possible under strong assumptions about the (unobserved) covariate vector. This

Re: [R] peak detection

2010-12-14 Thread Joe Stuart
Thank you. I will look at that also. On Mon, Dec 13, 2010 at 9:49 PM, Michael Bedward wrote: > Hi Joe, > > Just for info, I've done this in the past by applying lowess followed > by diff to a vector, then identifying points with change of sign in > the diffs. > > Michael > > On 14 December 2010 1

[R] Installing R-packages in Windows

2010-12-14 Thread Erik Lukac
Hi there, I have the following problem and I hope somebody might help me. First of all: I am using WinXP SP3 (english and/or german) with R in Version 2.10.0. Now I am trying to install some packages but unfortunately I am getting a weird error. No matter which package I am trying to install

Re: [R] stepAIC: plot predicted versus observed

2010-12-14 Thread sergeetienneparent
I figured out how to call coefficients and R² from the summary. - fit<-lm(...) #multiple regression function stepComp <- stepAIC(fit, direction="both") summary(stepComp)$coef[1,1] #call first coefficient summary(stepComp)$coef[1,2] #call Std. Error of first coefficient summary(ste

Re: [R] curve

2010-12-14 Thread Sarah Goslee
You are most likely to get reasonable help if you provide at a minimum your OS, the version of R you're using, and the error message you get. And also if you send your replies to the R-help list, not just me. Sarah On Tue, Dec 14, 2010 at 10:58 AM, Val wrote: > Thank you Sarah, > > > It worked

Re: [R] Date variable error

2010-12-14 Thread Ben Bolker
nps.gov> writes: > > Greetings > In attempting to create a date variable based on month (e.g., > February, April, etc.) and year (e.g., 2006) data, wherein I converted > Month to a factor with Jan=1...Dec=12, I used the following command: > > data$Date<-mdy.date(month=data$Month,day=15,ye

[R] factor predictor using random forest

2010-12-14 Thread Jing Shi
Hello everyone, I have been doing a binary classification using random forest from the library "randomForest". One of the predictors is a factor variable, which is known to be highly related to the binary response I am trying to predict. Other 80 predictors are numeric. Totally I have 44 subjects.

Re: [R] Question

2010-12-14 Thread Gerrit Eichner
On Tue, 14 Dec 2010, Matthew Rosett wrote: How do I determine if my data deviate from the normal distribution? The sample size is 1000 (weights of people). See ?qqnorm and/or ?shapiro.test and/or a text book on applied statistics and/or google for "testing normality". Hth, Gerrit PS

Re: [R] Question about cut()

2010-12-14 Thread Gerrit Eichner
Tianchan, why aren't you just using col_no <- cut(r,c(0,2,4,6,8,10,100)) levels(col_no) <- c("<2%","2-4%","4-6%","6-8%","8-10%",">10%") ? Your use of as.numeric() is nonsensical; check step by step what is happening with that. Hth, Gerrit On Tue, 14 Dec 2010, Tianchan Niu wrote: Dear all

Re: [R] Selecting non-empty elements after strsplit of string

2010-12-14 Thread Jinyan Huang
unlist(strsplit(output," +")) On Tue, Dec 14, 2010 at 2:09 PM, Scott Chamberlain wrote: > Hello, > > I am attempting to manipulate strings in which there are differing amounts of > whitespace before and after each element taht I want to keep (any word, > letter, or number). However, after strs

Re: [R] Selecting non-empty elements after strsplit of string

2010-12-14 Thread Ivan Calandra
Hi, I have just recently started to use regular expression, so I'm not sure that my solution would be valid in every case. But it works in yours: > unlist(strsplit(output, split=" +")) [1] "a""b""" "6" It would split them whatever the number of spaces between them is (because of t

Re: [R] Question about cut()

2010-12-14 Thread Ben Bolker
Tianchan Niu isis.georgetown.edu> writes: > > Dear all, > I would like to use cut() to make numerics to factors, the sample codes are as follows. However, the result is > not what I want, since r[3] = 9 should be in the interval of "8-10%" rather than "2-4%". Maybe cut() is not > the right funct

Re: [R] writing sample values in to a file

2010-12-14 Thread Dennis Murphy
Hi: On Mon, Dec 13, 2010 at 4:28 PM, chandu wrote: > > Dear all, > > I am relatively new to R. I would like to know how can we write the > realizations (for example generated through rnorm or runif) in to a data > file. It would be very inefficient to first generate values and then write > them

Re: [R] Question about cut()

2010-12-14 Thread Gavin Simpson
On Tue, 2010-12-14 at 15:40 +, Tianchan Niu wrote: > Dear all, > I would like to use cut() to make numerics to factors, the sample codes are > as follows. However, the result is not what I want, since r[3] = 9 should be > in the interval of "8-10%" rather than "2-4%". Maybe cut() is not the r

Re: [R] writing sample values in to a file

2010-12-14 Thread Dieter Menne
chandu wrote: > > I am relatively new to R. I would like to know how can we write the > realizations (for example generated through rnorm or runif) in to a data > file. It would be very inefficient to first generate values and then write > them in to file using "write" function. Instead, is th

Re: [R] lines and points without margin

2010-12-14 Thread Ben Bolker
Andrew Collier gmail.com> writes: > i am sure that this is a trivial question but i have not been able to > find an answer by searching the mailing lists. i want to plot points on > a graph, joined by lines. the command that i am using is > > points(x, y, type = "b", pch = 21) > > this plots ni

[R] Selecting non-empty elements after strsplit of string

2010-12-14 Thread Scott Chamberlain
Hello, I am attempting to manipulate strings in which there are differing amounts of whitespace before and after each element taht I want to keep (any word, letter, or number). However, after strsplit and unlist, I know how to select specific elements with "[ ]", but I want to select instead all e

[R] Selecting non-empty elements after strsplit of string

2010-12-14 Thread Scott Chamberlain
Hello, I am attempting to manipulate strings in which there are differing amounts of whitespace before and after each element taht I want to keep (any word, letter, or number). However, after strsplit and unlist, I know how to select specific elements with "[ ]", but I want to select instead a

[R] Question

2010-12-14 Thread Matthew Rosett
How do I determine if my data deviate from the normal distribution? The sample size is 1000 (weights of people). __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] Re : Re: descriptive statistics

2010-12-14 Thread effeesse
Thanks! I got the results! Now I would like to put them in a nice and readable plot to see if there are outlier means or variances. Using "plot(by_many$mean)" I got "Error in by_many$mean : object of type 'closure' is not subsettable". Another question: I have done the principal components analys

Re: [R] lines and points without margin

2010-12-14 Thread baptiste auguie
Hi, Try the following, plot(1:10,rnorm(10),t="o") ## fill the points in white plot(1:10,rnorm(10),t="o",pch=21,bg="white") You could also try this with Grid graphics, library(gridExtra) # like type="o" grid.barbed(space=0) # like type="b" grid.barbed(space=1) # like the example above, but with

[R] labelling of axis in plot.ca

2010-12-14 Thread Manderscheid Katharina
hi all, how can i get correspondence analysis plots (package ca, plot.ca()) with the inertia on the two dimensions of the map? thanks, kat [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] lines and points without margin

2010-12-14 Thread Andrew Collier
hi, i am sure that this is a trivial question but i have not been able to find an answer by searching the mailing lists. i want to plot points on a graph, joined by lines. the command that i am using is points(x, y, type = "b", pch = 21) this plots nice open circles at the data points and draws

[R] Question about cut()

2010-12-14 Thread Tianchan Niu
Dear all, I would like to use cut() to make numerics to factors, the sample codes are as follows. However, the result is not what I want, since r[3] = 9 should be in the interval of "8-10%" rather than "2-4%". Maybe cut() is not the right function to use for my situation. Please help. > r <- c(1

Re: [R] Browsing through a dataframe page by page (like with shell command more)

2010-12-14 Thread Alexandre CESARI
Thank you all for your input. View is quite nice, despite the fact that you need to be in a X session and it seems(?) difficult to copy paste data out of the view. page(my_var) works great and is most similar to what I had in mind. TkListView seems interesting but quite slow for large list or fr

Re: [R] curve

2010-12-14 Thread Sarah Goslee
Val, Here's the complete console output. The graph produced is at: http://www.functionaldiversity.org/temp/curve.png R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-bit) R is free software and co

[R] rpart - how to estimate the “meaningful” predictors for an outcome (in classification t rees)

2010-12-14 Thread Tal Galili
Hi dear R-help memebers, When building a CART model (specifically classification tree) using rpart, it is sometimes obvious that there are variables (X's) that are meaningful for predicting some of the outcome (y) variables - while other predictors are relevant for other outcome variables (y's onl

Re: [R] rpart.object help

2010-12-14 Thread Terry Therneau
> On Sun, 12 Dec 2010, jagdeesh_mn wrote: > >> Hi, >> >> Suppose i have generated an object using the following : >> fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) >> >> And when i print fit, i get the following : >> >> n= 81 >> >> node), split, n, loss, yval, (yprob) >> * denot

Re: [R] How to plot Ellipsoid like function

2010-12-14 Thread Duncan Murdoch
On 14/12/2010 8:45 AM, Uwe Wolfram wrote: Dear R-Users, I am trying to plot an ellipsoid like function that represents some physical threshold in its eigenvalue space. I am facing a few problems generating a figure I need for my thesis. A small example looks as follwos where the two contour3d pl

Re: [R] How to plot Ellipsoid like function

2010-12-14 Thread Uwe Wolfram
Dear R-Users, I am trying to plot an ellipsoid like function that represents some physical threshold in its eigenvalue space. I am facing a few problems generating a figure I need for my thesis. A small example looks as follwos where the two contour3d plots do NOT overlay as desired so you may try

[R] problems with lattice barchart

2010-12-14 Thread Juan Santos
Hello everybody! I´m trying to create figures summarizing the abundance of a given species (y), by its length classes (x), year (conditional factor) and a grouping named as "fraction". I am using the lattice´s barchart but some problems arises: When I run the function, the si

Re: [R] multivariate multi regression / aligning objects anything in bio or mapping?

2010-12-14 Thread Mike Marchywka
> From: pda...@gmail.com > Date: Tue, 14 Dec 2010 13:50:27 +0100 > To: bastiaan.berg...@wdc.com > CC: r-help@r-project.org > Subject: Re: [R] multivariate multi regression > > > On Dec 14, 2010, at 03:21 , Bastiaan Bergman wrote: > > > That doesn't work

Re: [R] multivariate multi regression

2010-12-14 Thread peter dalgaard
On Dec 14, 2010, at 03:21 , Bastiaan Bergman wrote: > That doesn't work, one would get two different answers depending on the > order of execution. > > The physics is: Overlay error on a Silicon wafer. One wafer has many flash > fields, each flash field has multiple locations where the overlay e

Re: [R] Drawing Maps of detailed Australian regions

2010-12-14 Thread Roger Bivand
Please consider posting to R-sig-geo at https://stat.ethz.ch/mailman/listinfo/r-sig-geo https://stat.ethz.ch/mailman/listinfo/r-sig-geo , where maybe someone will be able to point you to a data source. Roger Wang, Kevin (SYD) wrote: > > Hi all, > > I'm trying to draw a bubble plot over a ma

Re: [R] Drawing Maps of detailed Australian regions

2010-12-14 Thread Barry Rowlingson
On Tue, Dec 14, 2010 at 10:45 AM, Wang, Kevin (SYD) wrote: > Hi all, > > I'm trying to draw a bubble plot over a map -- where the map shows local > government areas (LGA) in Australia (or other structures under the Australian > Standard Geographical Classification), but am not sure where I can f

Re: [R] spatial clusters

2010-12-14 Thread Roger Bivand
SKATER is included in the spdep package, and was contributed by its original authors. Roger Georg Ruß wrote: > > On 10/12/10 23:26:28, dorina.lazar wrote: >> I am looking for a clustering method usefull to classify the countries in >> some clusters taking account of: a) the geographical distan

Re: [R] Saving iterative components

2010-12-14 Thread Ivan Calandra
Hi, I'm trying to understand when and how to use do.call(). In this case, would it work with do.call() instead of lapply(), like this? vars <- list(names(Tmese[, -(1:2)])) res <- do.call(idw.cv, vars) Thanks, Ivan Le 12/14/2010 11:48, Liviu Andronic a écrit : On Tue, Dec 14, 2010 at 10:34 AM,

Re: [R] Saving iterative components

2010-12-14 Thread Liviu Andronic
On Tue, Dec 14, 2010 at 10:34 AM, Annalaura wrote: > > Thanks a lot Uwe Ligges, I've abandoned R for a few time but now I'm working > with it, so I've a question about the last problem that you solved: instead > to write > cv_1994<- idw.cv("X01_1994") > cv_1995<- idw.cv("X01_1995") > cv_1996<- idw

[R] Drawing Maps of detailed Australian regions

2010-12-14 Thread Wang, Kevin (SYD)
Hi all, I'm trying to draw a bubble plot over a map -- where the map shows local government areas (LGA) in Australia (or other structures under the Australian Standard Geographical Classification), but am not sure where I can find the data to plot such maps (e.g. draw the state of Northern Ter

Re: [R] Saving iterative components

2010-12-14 Thread Annalaura
Thanks a lot Uwe Ligges, I've abandoned R for a few time but now I'm working with it, so I've a question about the last problem that you solved: instead to write cv_1994<- idw.cv("X01_1994") cv_1995<- idw.cv("X01_1995") cv_1996<- idw.cv("X01_1996") cv_1997<- idw.cv("X01_1997") .

  1   2   >