Re: [R] Error on start R in server

2010-02-08 Thread Jiiindo
Thanks for your answer, I can run it with an application Java normal. In my web-application, when i need, i start R et calling R function (new REvaluator).eval("1+1") to calcule an expression "1+1"example. And output of your code: Loading RInterpreter library Load the Java VM with .JavaInit() R v

Re: [R] Installation require proxy settings (continued)

2010-02-08 Thread Van Wyk, Jaap
Thanks to Greg and Michael for their advice. I have tried all these possibilities (and other); nothing seems to work; I persistently get the message: In open.connection(con, "r") : cannot open: HTTP status was '407 Proxy Authentication Required' It seems as if "proxy authentication required" is

Re: [R] "1 observation deleted due to missingness" from summary() on the result of aov()

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 10:28 PM, bluesky...@gmail.com wrote: I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? summary(afit)

[R] "1 observation deleted due to missingness" from summary() on the result of aov()

2010-02-08 Thread bluesky315
I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? > summary(afit) Df Sum Sq Mean Sq F value Pr(>F) A 2 0.328 0

Re: [R] Problem with R on USB-drive

2010-02-08 Thread jim holtman
I run R off a flash drive. I just copy the directory that it was installed on my hard drive to the flash drive and things work fine. On Mon, Feb 8, 2010 at 2:28 PM, Lauri Nikkinen wrote: > Hi, > > I installed R on USB-drive, but when I run Rgui.exe from bin folder, I get > this error: > > --

Re: [R] Dividing one column of form xx-yy into two columns, xx and yy

2010-02-08 Thread Ista Zahn
Or, if you don't mind loading another library: library(reshape) colsplit(dat$V1, "-", names=c("va", "vb")) -Ista On Tue, Feb 9, 2010 at 2:19 AM, Gabor Grothendieck wrote: > If you are willing to use an outside utility, tr, and you are using > UNIX then you can pipe the input through it so read.

Re: [R] Wilcoxon signed-ranks test using package coin ?

2010-02-08 Thread Peter Ehlers
Dale Steele wrote: Given the following data, and hypothesized median M.0 I've found a method to implement the Wilcoxon signed-rank test. Data: (with one zero difference and tied ranks) x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, 91,142, 119, 137) M.0 <- 119 library(exactRa

Re: [R] Conditional plot

2010-02-08 Thread mnstn
Thanks Dennis and David, That is precisely what I was looking for. I will remember to post the data in a readable format in future. Cheers! -- View this message in context: http://n4.nabble.com/Conditional-plot-tp1473754p1473834.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Dividing one column of form xx-yy into two columns, xx and yy

2010-02-08 Thread Gabor Grothendieck
If you are willing to use an outside utility, tr, and you are using UNIX then you can pipe the input through it so read.csv sees all the dashes as commas: > cat("A,B-C,D + 1,2-3,4 + 5,6-7,8 + ", file = "dashcomma.dat") > > read.csv(pipe("tr - , < dashcomma.dat")) A B C D 1 1 2 3 4 2 5 6 7 8 On

Re: [R] Dividing one column of form xx-yy into two columns, xx and yy

2010-02-08 Thread Bill.Venables
Here is one way. > dat V1 1 43-156 2 43-43 3 1267-18 > dat <- within(dat, { + m <- do.call("rbind", strsplit(as.character(V1), "-")) + XX <- as.numeric(m[,1]) + YY <- as.numeric(m[,2]) + rm(m) + }) > dat V1 YY XX 1 43-156 156 43 2 43-43 43 43 3 1267-18 18 1267 > B

Re: [R] Selecting single TAZ based on area proportion

2010-02-08 Thread Nikhil Kaza
try this t <- TazProperties.. v <- aggregate(t$Area, by=list(t$TAZ,t$Props), sum) names(v) <- c("TAZ", "Prop", "area") tapply(v$area, v$Prop, function(x) v$TAZ[which.max(x)]) note that you have to deal with the cases where there is a tie for the maximum. The above just returns the first maximu

Re: [R] Conditional plot

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 7:01 PM, mnstn wrote: Hello All, I have the following data set: all [,1] [,2] [1,] 297.04115 286.34645 [2,] 303.94056 270.81590 [3,] 297.87190 290.48009 [4,] 305.81938 304.26238 [5,] 294.92061 92.14025 [6,] 72.09721 304.83084 [7,] 66.53062 279.65700 [8,]

Re: [R] Conditional plot

2010-02-08 Thread Dennis Murphy
Hi: Since you didn't provide your data in a readable form for others, we had to resort to other methods: x <- rnorm(100, 180, 20) y <- rnorm(100, 190, 15) df <- data.frame(x = x, y = y) plot(y ~ x, data = df, subset = y > 200) My plot has y values strictly above 200. Is that what you wanted? HT

Re: [R] release memory

2010-02-08 Thread milton ruser
Try gc() best milton On Mon, Feb 8, 2010 at 5:16 PM, dys0022 wrote: > > I am a new R user with the latest Ubuntu release. > My executions consume large amount of memory (up to 1.6 GB). When I try to > release the memory using "rm(list=ls())", R still occupies 1.6GB. (I also > tried to use rm on

Re: [R] What is the equivalent function in R to xyplot in S?

2010-02-08 Thread Liviu Andronic
On 2/8/10, Ista Zahn wrote: > Try help.search("xyplot"). If nothing comes up, try RSiteSearch("xyplot"). > Otherwise, > require(sos) > findFn("xyplot") Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Markus Weisner
Thanks. Used getGeneric("[") to figure out the general format for the setMethod, but am having some problem with how to set up the actual function: > getGeneric("[") standardGeneric for "[" defined from package "base" function (x, i, j, ..., drop = TRUE) standardGeneric("[", .Primitive("[")) Me

[R] release memory

2010-02-08 Thread dys0022
I am a new R user with the latest Ubuntu release. My executions consume large amount of memory (up to 1.6 GB). When I try to release the memory using "rm(list=ls())", R still occupies 1.6GB. (I also tried to use rm on the specific arrays which I know to be large). What could be the reason for tha

[R] Conditional plot

2010-02-08 Thread mnstn
Hello All, I have the following data set: > all [,1] [,2] [1,] 297.04115 286.34645 [2,] 303.94056 270.81590 [3,] 297.87190 290.48009 [4,] 305.81938 30

Re: [R] Dividing one column of form xx-yy into two columns, xx and yy

2010-02-08 Thread Peter Alspach
Tena koe Mike ?strsplit for post input separation. AFAIK there is one cannot specify multiple separators, but: library(fortunes) fortune('this is R') HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf O

Re: [R] Color intervals in image.plot function

2010-02-08 Thread Jim Lemon
On 02/09/2010 04:45 AM, FMH wrote: Hi, The script below is my current coding in order to produce a contour plot of temperature across altitude and time. In my case, time,altitude and temperature are represented by x, y and z variables. ## Brazilan

Re: [R] object 'xxx' not found

2010-02-08 Thread Rolf Turner
On 9/02/2010, at 12:51 PM, Daniel Malter wrote: > The for loop tries to write into an object that does not yet exist. Do > month.observed=NULL prior to the loop. Bad advice. As Duncan Murdoch just pointed out, this is inefficient. Compare: > x <- NULL > system.time(for(i in 1:5) x[i] <- 42

[R] R ggplot2 legend text left justify

2010-02-08 Thread Paul Sutcliffe
In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = theme_text(size = 9,hjust=0)) changes the size of the text OK but it remains right justified. > mydata=data.frame(RowID=c("A","B","C"),Name=c("long long long long long name","short name ","medium m

Re: [R] Problem with R on USB-drive

2010-02-08 Thread Duncan Murdoch
Lauri Nikkinen wrote: Hi, I installed R on USB-drive, but when I run Rgui.exe from bin folder, I get this error: --- R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY N

Re: [R] object 'xxx' not found

2010-02-08 Thread Daniel Malter
The for loop tries to write into an object that does not yet exist. Do month.observed=NULL prior to the loop. HTH, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.o

Re: [R] object 'xxx' not found

2010-02-08 Thread Duncan Murdoch
emorway wrote: The following line of code seems fairly straight forward, yet it is kicking back an error message: for (i in 1:length(mean.natveg.frac)){month.observed[i]=as.numeric(names(mean.natveg.frac[i]))%%12} Error message: Error in month.observed[i] = as numeric(names(mean.natveg.frac[i])

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Martin Morgan
On 02/08/2010 02:54 PM, Markus Weisner wrote: > Thanks. Used getGeneric("[") to figure out the general format for the > setMethod, but am having some problem with how to set up the actual > function: > >> getGeneric("[") > standardGeneric for "[" defined from package "base" > > function (x, i, j

[R] object 'xxx' not found

2010-02-08 Thread emorway
The following line of code seems fairly straight forward, yet it is kicking back an error message: for (i in 1:length(mean.natveg.frac)){month.observed[i]=as.numeric(names(mean.natveg.frac[i]))%%12} Error message: Error in month.observed[i] = as numeric(names(mean.natveg.frac[i]))%%12 : object '

[R] Dividing one column of form xx-yy into two columns, xx and yy

2010-02-08 Thread ZeMajik
I have a data set where one column consists of two numerical factors, separated by a "-". So my data looks something like this: 43-156 43-43 1267-18 . . . There are additional columns consisting of single factors as well, so reading the csv file (where the data is stored) with the sep="-" additio

Re: [R] mle.stepwise

2010-02-08 Thread Ben Bolker
eariasca math.ucsd.edu> writes: > > Hello, > > I have a basic question on mle.stepwise, which seems to return > strange answers, even on a basic example. I posted this last May but > never got an answer. I resend it here hoping it will this time. > > # BEGIN > [snip] > # END > > I am ru

Re: [R] interp function in package akima

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 5:06 PM, Sacha Viquerat wrote: hello! does anyone know how to get values out of an interp object (from akima package)? ive constructed an elevation map and would like to numerically see the calculated z values of data points, which were not empirically sampled (basically

Re: [R] What is the equivalent function in R to xyplot in S?

2010-02-08 Thread Ista Zahn
Try help.search("xyplot"). If nothing comes up, try RSiteSearch("xyplot"). -Ista On Mon, Feb 8, 2010 at 10:31 PM, wrote: > Page 140 of MASS uses the function xyplot. But I don't find it in R. > Is there a package that I should load to use xyplot. Or there is a > function with a different name i

Re: [R] What is the equivalent function in R to xyplot in S?

2010-02-08 Thread Peter Alspach
Tena koe library(lattice) ?xyplot HTH . Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > bluesky...@gmail.com > Sent: Tuesday, 9 February 2010 11:31 a.m. > To: r-h...@stat.math.ethz.ch > Subject: [R] Wh

[R] What is the equivalent function in R to xyplot in S?

2010-02-08 Thread bluesky315
Page 140 of MASS uses the function xyplot. But I don't find it in R. Is there a package that I should load to use xyplot. Or there is a function with a different name in R that does the same thing as xyplot in S. xyplot(Gas ~ Temp | Insul, whiteside, panel = function(x, y, ...) { panel.xyplot(x, y

[R] mle.stepwise

2010-02-08 Thread eariasca
Hello, I have a basic question on mle.stepwise, which seems to return strange answers, even on a basic example. I posted this last May but never got an answer. I resend it here hoping it will this time. # BEGIN require(wle) x1 = runif(100) x2 = runif(100) y = 3 + 2*x1 + rnorm(100)

[R] interp function in package akima

2010-02-08 Thread Sacha Viquerat
hello! does anyone know how to get values out of an interp object (from akima package)? ive constructed an elevation map and would like to numerically see the calculated z values of data points, which were not empirically sampled (basically: id like to see the altitude at locations x,y which ha

[R] Invitation to connect on LinkedIn

2010-02-08 Thread Scott Hyde
LinkedIn Scott Hyde requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Scott Accept invitation from Scott Hyde http://www.linkedin.com/e/qlt6CtWzi7sEoE_As_C0_wMfEZD2c-gGLF

[R] Mixed logit models with a random coefficient

2010-02-08 Thread Min Chen
Hi All, Sorry to bother you. I'm trying to estimate a set of discrete choice data in R with mixed logit models where one coefficient is random and normally distributed. I've searched on the R help archive and don't see much information very specific to what I'm doing, so I write the code mysel

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Martin Morgan
On 02/08/2010 01:22 PM, Markus Weisner wrote: > Worked like a charm!! Thank you so much. I just plugged the following into > my code ... > > setMethod("$", "CADresponses", function(x, name) slot(x, name)) > > ... and it worked perfect. If you don't mind, I have a quick follow up > question, us

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Markus Weisner
Worked like a charm!! Thank you so much. I just plugged the following into my code ... setMethod("$", "CADresponses", function(x, name) slot(x, name)) ... and it worked perfect. If you don't mind, I have a quick follow up question, using your example setClass("A", representation(a="numeric",

Re: [R] constraining functions for optim()

2010-02-08 Thread Guillaume Théroux Rancourt
Hi Ravi, > It makes no sense to set your constraints as the solution that you want. The thing is that y.1 and y.2 are too far away from the measured values. These values (photosynthesis assimilation rates) should not be as far away from each other. With the data I sent where you proposed a very

Re: [R] specifying colors in a heatmap/image -like plot

2010-02-08 Thread kerimcan
David and Jim, thanks for your help. Your advice was exactly what I needed. I tinkled with the "col" argument before but I was trying to assign colors to numbers with a command like: col(1<-"green",2<-"blue") Usually I need to see an example before I can implement something correctly. Thank

Re: [R] Contributed packages

2010-02-08 Thread Sharpie
Satish Vadlamani wrote: > > Folks: > If you wanted to find out about what are the contributed packages and > classify them, how would you go about it? For someone new like me, I would > like to know what the possibilities are. When I click on "install > packages" on my Windows version of R, it g

Re: [R] constraining functions for optim()

2010-02-08 Thread Ravi Varadhan
It makes no sense to set your constraints as the solution that you want. I also don’t like your non-smooth objective function: abs(y1 + y2). It is also wrong. It should be abs(y1) + abs(y2), but even that is not preferable since it is non-smooth. What was wrong with the approach that I already

[R] Hypercube in R

2010-02-08 Thread Andrej Kastrin
Dear all, Does anybody have an idea or suggestion how to construct (plot) 4-dimensional hypercube in R. Thanks in advance for any pointers. Regards, Andrej __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] using a variable name stored in another variable?

2010-02-08 Thread Chris Seidel
Solved! Duncan Murdoch got it right: > I think you want > > save(list=myobjectname, file= ...) > > assuming that the object has already been created with that name. If > it hasn't, you'll need two steps: > > assign( myobjectname, value) > save(list=myobjectname, file=...) [...] This works grea

[R] Wilcoxon signed-ranks test using package coin ?

2010-02-08 Thread Dale Steele
Given the following data, and hypothesized median M.0 I've found a method to implement the Wilcoxon signed-rank test. Data: (with one zero difference and tied ranks) x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, 91,142, 119, 137) M.0 <- 119 > library(exactRankTests) Package ‘

Re: [R] Error on start R in server

2010-02-08 Thread Martin Morgan
On 02/08/2010 12:51 AM, Jiiindo wrote: > > Hello all, > (Thank for your reply) > I have a web-application in Apache Tomcat, when i start R in this > application, > I used packe RSJava > Code > ROmegahatInterpreter interp; > String [] rargs = {"--no-save"}; > REvaluator e; > i

[R] constraining functions for optim()

2010-02-08 Thread Guillaume Théroux Rancourt
Hi list! I am optimizing one function with two data sets where the unknown values (Vcmax and gi) are the same in each dataset (see script below). The script works, but I would like to add other constraints to this function. In this function, the optimization is carried out like: ### code and f

[R] Poisson and neg. bin. regression with random effects

2010-02-08 Thread Bob Patrick
Hi there, I have relative abundance data for 13 mammal species that I collected at various sites that ranged in road density. I'm trying to determine the effect of road density on animal abundance across body sizes. For most species, I have data that was collected in one year but for

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Martin Morgan
On 02/07/2010 08:31 PM, Markus Weisner wrote: > I created some S4 objects that are essentially data frame objects. The S4 > object definitions were necessary to verify data integrity and force a > standardized data format. I am, however, finding myself redefining all the > typical generic functio

[R] Problem with R on USB-drive

2010-02-08 Thread Lauri Nikkinen
Hi, I installed R on USB-drive, but when I run Rgui.exe from bin folder, I get this error: --- R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welc

[R] Selecting single TAZ based on area proportion

2010-02-08 Thread LCOG1
Good day all, I am having an issue coercing my data. Below i have some data on taxlots and an associated TAZ(transportation analsysi zone) that each property is within. The main issue is that some properties cross TAZ boundaries so i need to make a decision as to which TAZ the property belon

Re: [R] metafor package: effect sizes are not fully independent

2010-02-08 Thread Gang Chen
Thanks for the confirmation and pointer, Mike! Dr. Viechtbauer, I'm looking forward to the new functionality of specifying covariance structures in metafor(). Thanks both again for the great help, Gang On Sun, Feb 7, 2010 at 8:59 PM, Mike Cheung wrote: > Dear Gang, > > It seems that it is poss

Re: [R] Follow-up Question: data frames; matching/merging

2010-02-08 Thread Gabor Grothendieck
It works if you use character class rather than factors for your date strings. Note last arg to data.frame: > DF <- data.frame(V1=c(1,1,2,3,1,2), + V2=c('2002-03-13','1989-03-10','1988-01-20','1997-05-15','1996-11-18','2000-01-12'), + stringsAsFactors = FALSE) > aggregate(DF[2], DF[1], min) V

Re: [R] R wiki link ?

2010-02-08 Thread Philippe Grosjean
Prof. John C Nash wrote: Is this a transient problem, or has the link to the R wiki on the R home page (www.r-project.org) to http://wiki.r-project.org/ been corrupted? I can find http://rwiki.sciviews.org that works. Yes, the problem is known. I have to fix it. Best, Philippe Grosjean JN

Re: [R] R installation require proxy setting

2010-02-08 Thread Greg Snow
Look at ?download.file and scroll down to the section titled "Setting Proxies". -- 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

[R] Follow-up Question: data frames; matching/merging

2010-02-08 Thread Jonathan
Wow.. thanks for the deluge of responses! Aggregate seems like the way to go here. But, suppose that instead of integers in column V2, I actually have dates (and instead of keeping the minimum integer, I want to keep the earliest date): > df = > data.frame(V1=c(1,1,2,3,1,2),V2=c('2002-03-13','1

Re: [R] Color intervals in image function (image.plot)

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 12:06 PM, FMH wrote: Hi, The script below is my current coding in order to produce a contour plot of temperature across altitude and time. In my case, time,altitude and temperature are represented by x, y and z variables. ##

[R] Color intervals in image.plot function

2010-02-08 Thread FMH
Hi, The script below is my current coding in order to produce a contour plot of temperature across altitude and time. In my case, time,altitude and temperature are represented by x, y and z variables. ## Brazilan.Pallete <- colorRampPalette(c("blue"

[R] R wiki link ?

2010-02-08 Thread Prof. John C Nash
Is this a transient problem, or has the link to the R wiki on the R home page (www.r-project.org) to http://wiki.r-project.org/ been corrupted? I can find http://rwiki.sciviews.org that works. JN __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] How to reverse the axis direction in log plot?

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 12:30 PM, bluesky...@gmail.com wrote: On Mon, Feb 8, 2010 at 11:13 AM, Hrishi Mittal wrote: plot(1:10,1:10,log='xy',xlim=c(10,1)) What if I want to use the automatically computed limits? I could use the following command. But it is not a very clean user interface, as th

Re: [R] How to reverse the axis direction in log plot?

2010-02-08 Thread bluesky315
On Mon, Feb 8, 2010 at 11:13 AM, Hrishi Mittal wrote: > > plot(1:10,1:10,log='xy',xlim=c(10,1)) What if I want to use the automatically computed limits? I could use the following command. But it is not a very clean user interface, as the user has to compute the min and the max. Is there a way tha

Re: [R] How to reverse the axis direction in log plot?

2010-02-08 Thread Hrishi Mittal
plot(1:10,1:10,log='xy',xlim=c(10,1)) - Try http://prettygraph.com Pretty Graph , the easiest way to make R-powered graphs on the web. -- View this message in context: http://n4.nabble.com/How-to-reverse-the-axis-direction-in-log-plot-tp1473161p1473176.html Sent from the R help mailing li

Re: [R] simulat from dirichet process

2010-02-08 Thread Greg Snow
There are a couple of packages with rdirichlet functions, including gtools and bayesm (and probably others). If these do not do what you want, give us some more detail of what you are trying to do. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail

Re: [R] How to reverse the axis direction in log plot?

2010-02-08 Thread jim holtman
reverse the xlim; plot(1:10, 1:10, log='xy', xlim=rev(range(1:10))) On Mon, Feb 8, 2010 at 12:07 PM, wrote: > The following command gives me a plot where the axes are in log scale > but 'x' increases in the right direction. > > plot(1:10,1:10, log='xy') > > I want to change the plot such that

Re: [R] data frames; matching/merging

2010-02-08 Thread Gabor Grothendieck
Here are 3 solutions assuming DF contains the data frame: > # 1. aggregate > aggregate(DF[2], DF[1], min) V1 V2 1 a 2 2 b 9 3 c 4 > # 2. aggregate.formula - requires R 2.11.x > aggregate(V2 ~ V1, DF, min) V1 V2 1 a 2 2 b 9 3 c 4 > # 3. SQL using sqldf > library(sqldf) > sqldf("se

[R] How to reverse the axis direction in log plot?

2010-02-08 Thread bluesky315
The following command gives me a plot where the axes are in log scale but 'x' increases in the right direction. plot(1:10,1:10, log='xy') I want to change the plot such that it is still in log scale but 'x' decreases rather increases in the right direction. I'm wondering if there is an option to

[R] Color intervals in image function (image.plot)

2010-02-08 Thread FMH
Hi, The script below is my current coding in order to produce a contour plot of temperature across altitude and time. In my case, time,altitude and temperature are represented by x, y and z variables. ## Brazilan.Pallete <- colorRampPalette(c("blue",

Re: [R] data frames; matching/merging

2010-02-08 Thread hadley wickham
On Mon, Feb 8, 2010 at 10:39 AM, Jonathan wrote: > Hi all, >    I'm feeling a little guilty to ask this question, since I've > written a solution using a rather clunky for loop that gets the job > done.  But I'm convinced there must be a faster (and probably more > elegant) way to accomplish what

Re: [R] data frames; matching/merging

2010-02-08 Thread S Ellison
You could try aggregate: If we call your data frame df: aggregate(df[2], by=df[1], FUN=min) will get you what you asked for (if not necessarily what you need ;-) ) Switching the columns around is easy enough if you need to; proceeding stepwise: df.new<-aggregate(df[2], by=df[1], FUN=min) df.new

Re: [R] data frames; matching/merging

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 11:39 AM, Jonathan wrote: Hi all, I'm feeling a little guilty to ask this question, since I've written a solution using a rather clunky for loop that gets the job done. But I'm convinced there must be a faster (and probably more elegant) way to accomplish what I'm looking

Re: [R] data frames; matching/merging

2010-02-08 Thread jim holtman
> x <- read.table(textConnection("V1 V2 + 1a3 + 2a2 + 3b9 + 4c4 + 5a7 + 6b11"), header=TRUE) > closeAllConnections() > # close; matrix with rownames - easy enough to change into a dataframe if you > want > cbind(tapply

Re: [R] data frames; matching/merging

2010-02-08 Thread Ivan Calandra
Hi! I'm definitely not an expert in R (and it's my first reply!), but if I understand right, I think the aggregate function might do what you're looking for. Try ?aggregate to get more info. You might find what you need! HTH Ivan Le 2/8/2010 17:39, Jonathan a écrit : Hi all, I'm feel

Re: [R] data frames; matching/merging

2010-02-08 Thread jim holtman
On Mon, Feb 8, 2010 at 11:39 AM, Jonathan wrote: > Hi all, >    I'm feeling a little guilty to ask this question, since I've > written a solution using a rather clunky for loop that gets the job > done.  But I'm convinced there must be a faster (and probably more > elegant) way to accomplish what

[R] data frames; matching/merging

2010-02-08 Thread Jonathan
Hi all, I'm feeling a little guilty to ask this question, since I've written a solution using a rather clunky for loop that gets the job done. But I'm convinced there must be a faster (and probably more elegant) way to accomplish what I'm looking to do (perhaps using the "merge" function?). I

Re: [R] Memory Problem

2010-02-08 Thread S Ellison
>>> jim holtman 08/02/2010 14:09:52 >>> >Typically R does not have macros; I know exactly why Jim Holtman said that; R doesn't have a separate 'macro' construct with separate 'macro variables'. But it is perhaps a bit misleading to say that R doesn't have macros without saying a bit more about

Re: [R] x-axis plot problem

2010-02-08 Thread abotaha
Many many thanks.it is working now very well. again thanks a lot. -- View this message in context: http://n4.nabble.com/x-axis-plot-problem-tp1472286p1473006.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

Re: [R] using a variable name stored in another variable?

2010-02-08 Thread Thomas Lumley
On Sun, 7 Feb 2010, Sharpie wrote: Chris Seidel wrote: Hello, I'm trying to figure out how to create a data object, and then save it with a user-defined name that is input as a command line argument. I know how to create the object and assign it the new name, however, I can't figure out how

Re: [R] Data views (Re: (Another) Bates fortune?)

2010-02-08 Thread Douglas Bates
On Sun, Feb 7, 2010 at 2:40 PM, Emmanuel Charpentier wrote: > Note : this post has been motivated more by the "hierarchical data" > subject than the aside joke of Douglas Bates, but might be of interest > to its respondents. > > Le vendredi 05 février 2010 à 21:56 +0100, Peter Dalgaard a écrit : >

[R] confidence interval for negatively skewed, leptokurtic sample

2010-02-08 Thread pappnase
Hello, I´ve got a statistical problem that I hope you can help me with. It doesn´t have to do directly with R, so if there´s another forum which would suit better, please tell me! Now here´s the problem: I want to derive confidence intervals for a variable X, which is - given the descriptive

Re: [R] [BioC] objects masked from packages

2010-02-08 Thread James W. MacDonald
Hi Assa, First off, please don't cross-post. This is really an R-help question, as it is about the R language rather than a specific BioC package. Assa Yeroslaviz wrote: dear all, I have a problem with a masked object in a package we created here. we make a package for a workflow of interna

Re: [R] evolution of Nelder-Mead process

2010-02-08 Thread Ted Harding
On 08-Feb-10 14:50:59, Paul Hiemstra wrote: > Juliane Struve wrote: >> Dear list, >> >> I am looking for an R-only implementation of a Nelder-Mead process >> that can find local maxima of a spatially distributed variable, e.g. >> height, on a spatial grid, and outputs the coordinates of the new >

[R] optimized R-selection and R-replacement inside a matrix

2010-02-08 Thread Christine SINOQUET
Hello, I need to modify some huge arrays (2000 individuals x 50 000 variables). To format the data, I think I should benefit from optimized R-selection and R-replacement inside a matrix and prohibite a naive use of loops. Thank you in advance for providing information about the following proble

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Henrik Bengtsson
I was looking for a fast line counter as well a while ago and ended up writing a small function in R: countLines() in the R.utils package At least at the time, it was faster than readLines() [for unknown reasons]. It is also more memory efficient. It supports connections. I don't think it be

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Romain Francois
On 02/08/2010 04:16 PM, Hadley Wickham wrote: parser::nlines does it in C. Looks promising, but I need something that uses connections because I'm working with big bzipped files. Hadley Ah... the lack of c-level api for connections again ;-) -- Romain Francois Professional R Enthusiast +3

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread hadley wickham
Hi Ken, > How about something like > length(readLines(fname)) I'm trying to avoid the overhead of reading the file in twice. (I'm trying to preallocate a data structure for a chunked read) Hadley -- http://had.co.nz/ __ R-help@r-project.org mailin

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Hadley Wickham
> parser::nlines does it in C. Looks promising, but I need something that uses connections because I'm working with big bzipped files. Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] evolution of Nelder-Mead process

2010-02-08 Thread Paul Hiemstra
Juliane Struve wrote: Dear list, I am looking for an R-only implementation of a Nelder-Mead process that can find local maxima of a spatially distributed variable, e.g. height, on a spatial grid, and outputs the coordinates of the new point during each evaluation. I have found two previous thre

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Gabor Grothendieck
If you are willing to use an external program parse the result of: > system("wc -l small.dat") 10 small.dat On Windows there is a wc.exe program in the Rtools distribution. On Mon, Feb 8, 2010 at 9:16 AM, Hadley Wickham wrote: > Hi all, > > Is there a fast way to determine the number of lines i

Re: [R] Hi problem with read.csv

2010-02-08 Thread Dieter Menne
dvkirankumar wrote: > > I am getting problem with "read.csv()" > > ... > but if I am converting those files to "UTF-8" formate and after > loading > to R-project Object and again I checked for > coloumn names then its giving like > ... > "ï..FILEID" > > Add fileEncoding="UTF-8" Die

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Ken Knoblauch
Hadley Wickham rice.edu> writes: > > Hi all, > > Is there a fast way to determine the number of lines in a file? I'm > looking for something like count.lines analogous to count.fields. > > Hadley How about something like length(readLines(fname)) Ken _

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Romain Francois
Hi, parser::nlines does it in C. Romain On 02/08/2010 03:16 PM, Hadley Wickham wrote: Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- Romain Francois Professional R Enthusiast +33(0) 6

[R] objects masked from packages

2010-02-08 Thread Assa Yeroslaviz
dear all, I have a problem with a masked object in a package we created here. we make a package for a workflow of internal analysis of microarray data. to create the package we used: > install.packages(pkgs="affyAnalysis", repos=NULL) > R CMD INSTALL affyAnalysis Erzeuge Verzeichnisse ... Erzeu

[R] Fast way to determine number of lines in a file

2010-02-08 Thread Hadley Wickham
Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Memory Problem

2010-02-08 Thread jim holtman
What exactly is your definition of "macro"? What to you want to do? What is the problem that you are trying to solve? Why to you think macros will help? Typically R does not have macros; I assume that idea is a holdover from SAS. On Mon, Feb 8, 2010 at 4:30 AM, Meenakshi wrote: > > Hi, > > Can

[R] evolution of Nelder-Mead process

2010-02-08 Thread Juliane Struve
Dear list,   I am looking for an R-only implementation of a Nelder-Mead process that can find local maxima of a spatially distributed variable, e.g. height, on a spatial grid, and outputs the coordinates of the new point during each evaluation. I have found two previous threads about this topic,

Re: [R] Physically open Excel file from R

2010-02-08 Thread S Ellison
Try shell('\"file.xls\"') where 'file.xls' is the excel filename. The escaped quotes (\") are not strictly necessary if the filename contains no spaces, but they are essential if it does. >>> Sergey Goriatchev 08/02/2010 12:48:20 >>> Hello, everyone I wonder if it is possible to PHYSICALLY

[R] PriorControl MCLUST

2010-02-08 Thread narsis
Hi I have used MCLUST to fit a mixture Gaussian model to Data and now I want to do the same for a subgroup of data with the mean and variance of previous step. I mean, I want to use MCLUST only with known means and variances and determine only probability. I have seen Prior Control But I do not h

Re: [R] x-axis plot problem

2010-02-08 Thread David Winsemius
On Feb 8, 2010, at 5:00 AM, abotaha wrote: Thanks guys, it works now properly when I change axas="i" to axat="n", but there is a space between the box from the left side (y-axis) and the beginning plotted curve. please could you tell me how avoid that. any suggestions Add the xaxt but do

Re: [R] Counting by rows based on multiple criteria

2010-02-08 Thread Steve Murray
Spot on, thanks very much indeed. Steve _ Got a cool Hotmail story? Tell us now __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

  1   2   >