[R] How to mean, min lists and numbers

2010-07-12 Thread guox
I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck, Reduce('+',list(-1,2*c(1,1,0),2,c(-1,10,-1))) returns what we

Re: [R] make an model object (e.g. nlme) available in a user defined function (xyplot related)

2010-07-12 Thread Jun Shen
Dear Deepayan, Thank you for taking the time to look into this issue. I have a data object called Data, please find it at the end of the message. Then I can run the code below separately in the console. #Construct the nlme object

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread Duncan Murdoch
On 12/07/2010 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck,

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. You will advance in your understanding faster if you adopt the correct terminology: -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but ... which is

[R] Calculating Gwet's AC1 statistic

2010-07-12 Thread Pete St Marie
Hi, After searching the archives and Google and not turning up anything, I thought I'd ask here. Has anyone done an R package for calculating Gwet's AC1 statistic and variance? K.L. Gwet. Computing inter-rater reliability and its variance in the presence of high agreement. Br J Math Stat

[R] Quantmod Error Message

2010-07-12 Thread Tyler Campbell
I am trying to create a model using the Quantmod package in R. I am using the following string of commands: ema-read.csv(file=ESU0 Jul 7 1 sec data.csv) Bid=(ema$Bid) twentysell=EMA(Bid,n=1200) fortysell=EMA(Bid,n=2400) sigup-ifelse(twentysellfortysell,1,0)

Re: [R] print.trellis draw.in - plaintext (gmail mishap)

2010-07-12 Thread Mark Connolly
require(grid) require(lattice) fred = data.frame(x=1:5,y=runif(5)) vplayout - function (x,y) viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() pushViewport(viewport(layout=grid.layout(2,2))) p = xyplot(y~x,fred) print( p,newpage=FALSE,draw.in=vplayout(2,2)$name) On Mon, Jul 12, 2010

Re: [R] How to mean, min lists and numbers

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 11:19 AM, Duncan Murdoch wrote: On 12/07/2010 11:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list.

Re: [R] long to wide on larger data set

2010-07-12 Thread Matthew Dowle
Juliet, I've been corrected off list. I did not read properly that you are on 64bit. The calculation should be : 53860858 * 4 * 8 /1024^3 = 1.6GB since pointers are 8 bytes on 64bit. Also, data.table is an add-on package so I should have included : install.packages(data.table)

Re: [R] [R-pkgs] New package list for analyzing list survey experiments

2010-07-12 Thread Spencer Graves
I encourage all authors and maintainers of packages that they use findFn in the sos package to search for other uses of a name you want to use. The findFn function searches for matches in the help pages of contributed packages, including all of CRAN plus some elsewhere. The grepFn can

[R] Need help on date calculation

2010-07-12 Thread Daniel Murphy
If you want to use the mondate package you will need to specify the day of the month. Dates March-2010 and May-2010 are ambiguous. Recommend you choose last day of both months as representative days. Then those days will be integer months apart. a-mondate(March 31, 2010, displayFormat=%B %d, %Y)

[R] Extract Clusters from Biclust Object

2010-07-12 Thread delfin13
Dear all, I share the problem Linda Garcia and Ram Kumar Basnet described; I have a biclust object, containing several clusters. For drawing a heatmap, it is possible to specify the cluster to be plotted. However, I'd like to extract the clusters in this manner: Cond.1 Cond.2 Gene -

[R] in continuation with the earlier R puzzle

2010-07-12 Thread Raghu
When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well use C or any other language. The reason R is powerful is becasue it can handle large vectors without each element being manipulated? Please let me know where I am wrong. for(i in

[R] a small puzzle?

2010-07-12 Thread Raghu
I know the following may sound too basic but I thought the mailing list is for the benefit of all levels of people. I ran a simple if statement on two numeric vectors (news1o and s2o) which are of equal length. I have done an str on both of them for your kind perusal below. I am trying to compare

[R] How do I move axis labels closer to plot box?

2010-07-12 Thread chen jia
Hi there, I place a vector of strings as labels at the tick points by using axis(1,at=seq(0.1,0.7,by=0.1), labels=paste(seq(10,70,by=10),%,sep=), tick=FALSE) However, there is a large space between those labels and the boundary of plot box. I want to reduce this space so that the labels appear

[R] How do I convert a XML file to a data.frame?

2010-07-12 Thread Magnus Statistik
Hi, I have a problem converting a XML file, via the XML package, to a data.frame. The XML file looks like this: Transaction ID value=0044/ Var1 value=XYZ159/ Var2 value=_/ Var3 value=AMR1.0-INT-1005/ Var4 value=2010-05-25 10:44:16:673/ Var5 value=1/ Var6 value=0/ /Transaction

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Alain Guillet
I don't know what is wrong with your code but I believe you should use ifelse instead of a for loop: s - ifelse(news1o s2o, 1 , -1 ) Alain On 12-Jul-10 16:09, Raghu wrote: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well

Re: [R] a small puzzle?

2010-07-12 Thread jim holtman
You probably want to use ifelse s - ifelse(news1os2o, 1, -1) 'if' only handle a single logical expression. On Mon, Jul 12, 2010 at 10:02 AM, Raghu r.raghura...@gmail.com wrote: I know the following may sound too basic but I thought the mailing list is for the benefit of all levels of people.

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Seeliger . Curt
The reason R is powerful is becasue it can handle large vectors without each element being manipulated? Please let me know where I am wrong. for(i in 1:length(news1o)){ + if(news1o[i]s2o[i]) + s[i]-1 + else + s[i]--1 + } You might give ifelse() a shot here. s - ifelse(news1o s2o, 1,

Re: [R] a small puzzle?

2010-07-12 Thread Alain Guillet
In an if statement, you can use only elements. In your example, news1o and s2o are vectors so there is a warning saying the two vectors have a bigger length than one. If you don't send two messages about the same problem in two minutes, you can see what people answer you... For example, I

Re: [R] Can anybody help me understand AIC and BIC and devise a new metric?

2010-07-12 Thread Stephan Kolassa
Hi, one comment: Claeskens and Hjort define AIC as 2*log L - 2*p for a model with likelihood L and p parameters; consequently, they look for models with *maximum* AIC in model selection and averaging. This differs from the vast majority of authors (and R), who define AIC as -2*log L + 2*p and

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 10:09 AM, Raghu wrote: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well use C or any other language. The reason R is powerful is becasue it can handle large vectors without each element being

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Ted Harding
On 12-Jul-10 14:09:30, Raghu wrote: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well use C or any other language. The reason R is powerful is becasue it can handle large vectors without each element being manipulated? Please

Re: [R] Compress string memCompress/Decompress

2010-07-12 Thread Seth Falcon
On Mon, Jul 12, 2010 at 9:17 AM, Erik Wright eswri...@wisc.edu wrote: Hi Seth, Can you recreate the example below using dbWriteTable? Not sure if that is possible with the current dbWriteTable code (don't have time to explore that right now). You are welcome to poke around. You could wrap

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Ken Takagi
Richardson, Patrick Patrick.Richardson at vai.org writes: I'm trying to use multiple plotting colors in my code. My first ifelse statement successfully does what I want. However, now I want anything less than -4.5 to be green and the rest black. I want another col argument but can only use

[R] How to use mpi.allreduce() in Rmpi?

2010-07-12 Thread Eduardo García
Hi everybody! I have the next code which makes a reduction of the *a *variable in two slaves, using the Rmpi package. library(Rmpi) mpi.spawn.Rslaves(nslaves=2) reduc-function(){ a-mpi.comm.rank()+2 mpi.reduce(a,type=2, op=prod) return(paste(a=,a)) } mpi.bcast.Robj2slave(reduc)

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Steve Lianoglou
Hi, On Mon, Jul 12, 2010 at 12:02 PM, Richardson, Patrick patrick.richard...@vai.org wrote: I'm trying to use multiple plotting colors in my code. My first ifelse statement successfully does what I want. However, now I want anything less than -4.5 to be green and the rest black. I want

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Steve Lianoglou
One more thing: On Mon, Jul 12, 2010 at 12:55 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Mon, Jul 12, 2010 at 12:02 PM, Richardson, Patrick patrick.richard...@vai.org wrote: I'm trying to use multiple plotting colors in my code. My first ifelse statement successfully

[R] densities greater than 1 for values within an (0,1) intervall

2010-07-12 Thread Katja Hillmann
Hello, I used the command kdensity in order to calculate the density of fractions/ratios (e.g. number of longterm unemployed on total unemployment). Thus I try to calculate the denisty of values less than 1. However, the values of the kernel densitiy R provided (y-scale) are all greater than

Re: [R] How do I move axis labels closer to plot box?

2010-07-12 Thread Ken Takagi
chen jia chen_1002 at fisher.osu.edu writes: Check out the ?par(). Specifically mgp. HTH, Ken __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Steve Lianoglou
Ugh: Depending on what you want the plot for, perhaps you might consider changing your color palette from green - black - red to something like blue - black - yellow, since many folks who are color can not differentiate green from red all that well. ... folks who are color *blind* can not

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Richardson, Patrick
Steve, That worked perfectly. Thank You! Best regards, Patrick -Original Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: Monday, July 12, 2010 12:55 PM To: Richardson, Patrick Cc: r-help@r-project.org Subject: Re: [R] Multiple Ploting Colors Hi, On

Re: [R] Multiple Ploting Colors

2010-07-12 Thread Ken Takagi
Richardson, Patrick Patrick.Richardson at vai.org writes: I'm trying to use multiple plotting colors in my code. My first ifelse statement successfully does what I want. However, now I want anything less than -4.5 to be green and the rest black. I want another col argument but can only use

Re: [R] densities greater than 1 for values within an (0, 1) intervall

2010-07-12 Thread Jeff Newmiller
There is no constraint on the magnitude of probability density values, though the area under the curve must be equal to one. You may be thinking of cumulative probability distributions? If so, take a look at smoothed.df() in library (cwhmisc). Katja Hillmann katja.hillm...@wiso.uni-hamburg.de

[R] Calculating weibull's distribution mean, standard deviation, and variance

2010-07-12 Thread Oscar Rodriguez
Dear R community: Sorry if this question has a simple answer, but I am a new user of R. Do you know a command, or package that can estimate the weibull distribution's mean, standard deviation and variance? or can direct me to where to find it? Thanks in advance, Oscar Rodriguez

Re: [R] Compress string memCompress/Decompress

2010-07-12 Thread Erik Wright
Hi Seth, Can you recreate the example below using dbWriteTable? Thanks!, Erik On Jul 11, 2010, at 6:13 PM, Seth Falcon wrote: On Sun, Jul 11, 2010 at 11:31 AM, Matt Shotwell shotw...@musc.edu wrote: On Fri, 2010-07-09 at 20:02 -0400, Erik Wright wrote: Hi Matt, This works great, thanks!

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Huso, Manuela
Using Ted Harding's example: news1o - runif(100) s2o- runif(100) pt1 - proc.time() s - numeric(length(news1o))-1 # Set all of s to -1 s[news1os2o] -1# Change to 1 only those values of s # for which news1os2o pt2-

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Raghu
Thanks to you all. I stand corrected Ted and Manuela:) I am just an end user and trying to pick up from such forums. Many thanks sirs. On Mon, Jul 12, 2010 at 5:45 PM, Huso, Manuela manuela.h...@oregonstate.edu wrote: Using Ted Harding's example: news1o - runif(100) s2o-

[R] Calculate confidence interval of the mean based on ANOVA

2010-07-12 Thread Paul
I am trying to recreate an analysis that has been done by another group (in SAS I believe). I'm stuck on one part, I think because my stats knowledge is lacking, and while it's OT, I'm hoping someone here can help. Given this dataframe; foo*-*structure(list(OBS = structure(1:18, .Label = c(1,

[R] How to create sequence in month

2010-07-12 Thread Bogaso Christofer
Hi all, can anyone please guide me how to create a sequence of months? Here I have tried following however couldn't get success library(zoo) seq(as.yearmon(2010-01-01), as.yearmon(2010-03-01), by=1 month) Error in del/by : non-numeric argument to binary operator What is the correct

Re: [R] How to create sequence in month

2010-07-12 Thread MacQueen, Don
As in this example: seq(as.Date(2000/1/1), as.Date(2003/1/1), by=mon) On 7/12/10 11:25 AM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi all, can anyone please guide me how to create a sequence of months? Here I have tried following however couldn't get success

Re: [R] Calculating weibull's distribution mean, standard deviation, and variance

2010-07-12 Thread Peter Ehlers
Try fitdistr() in pkg MASS. -Peter Ehlers On 2010-07-12 11:17, Oscar Rodriguez wrote: Dear R community: Sorry if this question has a simple answer, but I am a new user of R. Do you know a command, or package that can estimate the weibull distribution's mean, standard deviation and

Re: [R] eliminating constant variables

2010-07-12 Thread Setlhare Lekgatlhamang
What was the question and answer here? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of pdb Sent: Sunday, July 11, 2010 5:23 AM To: r-help@r-project.org Subject: Re: [R] eliminating constant variables Importance: Low Awsome! It

Re: [R] How to create sequence in month

2010-07-12 Thread Stefan Grosse
Am 12.07.2010 20:25, schrieb Bogaso Christofer: library(zoo) seq(as.yearmon(2010-01-01), as.yearmon(2010-03-01), by=1 month) seq(as.Date(2010-01-01), as.Date(2010-03-01), by=1 month) hth Stefan __ R-help@r-project.org mailing list

[R] Error in storage.mode(test) - logical

2010-07-12 Thread Heiman, Thomas J.
Hi There, I get the following error from the code pasted below: Error in storage.mode(test) - logical : object 'HGBmt12_Natl_Ave_or_Facility' not found library(RODBC) library(car) setwd(c://temp//cms) a07.connect - odbcConnectAccess2007(DFC.accdb) sqlTables(a07.connect) ##provides list of

Re: [R] in continuation with the earlier R puzzle

2010-07-12 Thread Joshua Wiley
I wanted to point out one thing that Ted said, about initializing the vectors ('s' in your example). This can make a dramatic speed difference if you are using a for loop (the difference is neglible with vectorized computations). Also, a lot of benchmarks have been flying around, each from a

[R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
From the documentation I have found, it seems that one of the functions from package plyr, or a combination of functions like split and lapply would allow me to have a really short R script to analyze all my data (I have reduced it to a couple hundred thousand records with about half a dozen

[R] Subsetting Lists

2010-07-12 Thread Andrew Leeser
I am looking for a way to create a vector which contains the second element of every vector in the list. However, not every vector has two components, so I need to generate an NA for those missing. For example, I have created the following list: lst - list(c(a, b), c(c), c(d, e), c(f, g))

Re: [R] Subsetting Lists

2010-07-12 Thread Jorge Ivan Velez
Hi Andrew, Try sapply(lst, [, 2) HTH, Jorge On Mon, Jul 12, 2010 at 3:12 PM, Andrew Leeser wrote: I am looking for a way to create a vector which contains the second element of every vector in the list. However, not every vector has two components, so I need to generate an NA for those

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Erik Iverson
Your code is not reproducible. Can you come up with a small example showing the crux of your data structures/problem, that we can all run in our R sessions? You're likely get much higher quality responses this way. Ted Byers wrote: From the documentation I have found, it seems that one of

[R] What is the degrees of freedom in an nlme model

2010-07-12 Thread Jun Shen
Dear all, I want to do a F test, which involves calculation of the degrees of freedom for the residuals. Now say, I have a nlme object mod.nlme. I have two questions 1.How do I extract the degrees of freedom? 2.How is this degrees of freedom calculated in an nlme model? Thanks. Jun Shen Some

[R] Robust regression error: Too many singular resamples

2010-07-12 Thread Alexandra Denby
Hello. I've got a dataset that may have outliers in both x and y. While I am not at all familiar with robust regression, it looked like the function lmrob in package robustbase should handle this situation. When I try to use it, I get: Too many singular resamples Aborting fast_s_w_mem()

Re: [R] ggplot2: How to change font of labels in geom_text

2010-07-12 Thread Edwin Sun
I have the same problem and I wonder if there is any answer from the community. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-How-to-change-font-of-labels-in-geom-text-tp991579p2286671.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to create sequence in month

2010-07-12 Thread Gabor Grothendieck
On Mon, Jul 12, 2010 at 2:25 PM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi all, can anyone please guide me how to create a sequence of months? Here I have tried following however couldn't get success library(zoo) seq(as.yearmon(2010-01-01), as.yearmon(2010-03-01), by=1 month)

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread jim holtman
try 'drop=TRUE' on the split function call. This will prevent the NULL set from being sent to the function. On Mon, Jul 12, 2010 at 3:10 PM, Ted Byers r.ted.by...@gmail.com wrote: From the documentation I have found, it seems that one of the functions from package plyr, or a combination of

[R] ed50

2010-07-12 Thread Dipa Hari
I am using semiparametric Model  library(mgcv) sm1=gam(y~x1+s(x2),family=binomial, f) How should I  find out standard error for ed50 for the above model ED50 =( -sm1$coef[1]-f(x2)) / sm1$coef [2]   f(x2) is estimated value for non parametric term.   Thanks [[alternative HTML

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
OK, here is a stripped down variant of my code. I can run it here unchanged (apart from the credentials for connecting to my DB). Sys.setenv(MYSQL_HOME='C:/Program Files/MySQL/MySQL Server 5.0') library(TSMySQL) library(plyr) library(fitdistrplus) con - dbConnect(MySQL(), user=rejbyers,

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
Thanks Jim, I acted on your suggestion and found the result unchanged. :-( Then I noticed that fitdist doesn't like a sample size of 1 either. If, then, drop = TRUE results in all empty combinations of m_id, year and week being excluded, then (noticing the requirement is actually that the

[R] Statistical Learning and Datamining Course October 2010 Washington DC

2010-07-12 Thread Trevor Hastie
Short course: Statistical Learning and Data Mining III: Ten Hot Ideas for Learning from Data Trevor Hastie and Robert Tibshirani, Stanford University Georgetown University Conference Center Washington DC, October 11-12, 2010. This two-day course gives a detailed overview of statistical

Re: [R] What is the degrees of freedom in an nlme model

2010-07-12 Thread Bert Gunter
Jun: Short answer: There is no such thing as df for a nonlinear model (whether or not mixed effects). Longer answer: df is the dimension of the null space when the data are projected on the linear subspace of the model matrix of a **linear model ** . So, strictly speaking, no linear model, no

[R] SAS to R

2010-07-12 Thread trekvana
Hi everyone I dont know how to code in SAS but I do know how to code in R. Can someone please be kind enough to translate this into R code for me: proc mixed data = small method = reml; class id day; model weight = day/ solution ddfm = bw; repeated day/ subject=id type = unstructured; run;

[R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
Hi: Since I work with a few different fish runs my column headers change everytime I start a new Year. I have been using \Sexpr{} for my row and columns and now I am trying to use with my report column headers. \Sexpr{1,1} is row 1 column 1, what can I use for headers? I tried \Sexpr{0,1} but

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread Duncan Murdoch
On 12/07/2010 5:10 PM, Felipe Carrillo wrote: Hi: Since I work with a few different fish runs my column headers change everytime I start a new Year. I have been using \Sexpr{} for my row and columns and now I am trying to use with my report column headers. \Sexpr{1,1} is row 1 column 1, what

Re: [R] findInterval and data resolution

2010-07-12 Thread Duncan Murdoch
On 12/07/2010 5:25 PM, Bryan Hanson wrote: Hello Wise Ones... I need a clever way around a problem with findInterval. Consider: vec1 - 1:10 vec2 - seq(1, 10, by = 0.1) x1 - c(2:3) a1 - findInterval(x1, vec1); a1 # example 1 a2 - findInterval(x1, vec2); a2 # example 2 In the problem I'm

[R] Question about food sampling analysis

2010-07-12 Thread Sarah Henderson
Greetings to all, and my apologies for a question that is mostly about statistics and secondarily about R. I have just started a new job that (this week, apparently) requires statistical knowledge beyond my training (as an epidemiologist). The problem: - We have 57 food production facilities in

Re: [R] findInterval and data resolution

2010-07-12 Thread Steve Taylor
How about this: these = which(vec2 x1[1] | vec2 x1[2]) vec2[these] # Or using logical indexation directly: vec2[vec2 x1[1] | vec2 x1[2]] From: Bryan Hanson han...@depauw.edu To:R Help r-h...@stat.math.ethz.ch Date: 13/Jul/2010 9:28a Subject: [R] findInterval and data resolution Hello Wise

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
Thanks for the quick reply Duncan. I don't think I have explained myself well, I have a dataset named report and my column headers are run1,run2,run3,run4 and so on. I know how to access the data below those columns with \Sexpr{report[1,1]} \Sexpr{report[1,2]} and so on, but I can't access my

Re: [R] findInterval and data resolution

2010-07-12 Thread Bryan Hanson
Thanks Duncan... More appended at the bottom... On 7/12/10 5:38 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12/07/2010 5:25 PM, Bryan Hanson wrote: Hello Wise Ones... I need a clever way around a problem with findInterval. Consider: vec1 - 1:10 vec2 - seq(1, 10, by = 0.1)

[R] Comparison of two very large strings

2010-07-12 Thread harsh yadav
Hi, I have a function in R that compares two very large strings for about 1 million records. The strings are very large URLs like:- http://query.nytimes.com/gst/sitesearch_selector.html?query=US+Visa+Lawstype=nytx=25y=8. .. or of larger lengths. The data-frame looks like:- id url 1

[R] Matrix Column Names

2010-07-12 Thread David Neu
Hi, Is there a way to create a matrix in which the column names are not checked to see if they are valid variable names? I'm looking something similar to the check.names argument to data.frame. If so, would such an approach work for the sparse matrix classes in the Matrix package. Many thanks!

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 5:45 PM, Felipe Carrillo wrote: Thanks for the quick reply Duncan. I don't think I have explained myself well, I have a dataset named report and my column headers are run1,run2,run3,run4 and so on. I know how to access the data below those columns with

Re: [R] Comparison of two very large strings

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 6:03 PM, harsh yadav wrote: Hi, I have a function in R that compares two very large strings for about 1 million records. The strings are very large URLs like:- http://query.nytimes.com/gst/sitesearch_selector.html?query=US+Visa+Lawstype=nytx=25y=8 . .. or of

[R] Xyplot or Tin-R problem?

2010-07-12 Thread YANG, Richard ChunHSi
I ran the following script from xyplot Examples using Tin-R on Windows and saw no plot produced. EE - equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data=ethanol, prepanel = function(x,y) prepanel.loess(x, y, span=1), xlab=Compression Ratio, ylab=NOx (micrograms/J),

[R] Continuing on with a loop when there's a failure

2010-07-12 Thread Josh B
Hi R sages, Here is my latest problem. Consider the following toy example: x - read.table(textConnection(y1 y2 y3 x1 x2 indv.1 bagels donuts bagels 4 6 indv.2 donuts donuts donuts 5 1 indv.3 donuts donuts donuts 1 10 indv.4 donuts donuts donuts 10 9 indv.5 bagels donuts bagels 0 2 indv.6 bagels

Re: [R] Comparison of two very large strings

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 6:46 PM, David Winsemius wrote: On Jul 12, 2010, at 6:03 PM, harsh yadav wrote: Hi, I have a function in R that compares two very large strings for about 1 million records. The strings are very large URLs like:-

Re: [R] print.trellis draw.in - plaintext (gmail mishap)

2010-07-12 Thread Felix Andrews
The problem is that you have not pushed your viewport so it doesn't exist in the plot. (You only pushed the layout viewport). grid.ls(viewports = TRUE) ROOT GRID.VP.82 Try this: vp - vplayout(2,2) pushViewport(vp) upViewport() grid.ls(viewports = TRUE) #ROOT # GRID.VP.82 #GRID.VP.86

Re: [R] Continuing on with a loop when there's a failure

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 6:18 PM, Josh B wrote: Hi R sages, Here is my latest problem. Consider the following toy example: x - read.table(textConnection(y1 y2 y3 x1 x2 indv.1 bagels donuts bagels 4 6 indv.2 donuts donuts donuts 5 1 indv.3 donuts donuts donuts 1 10 indv.4 donuts donuts donuts 10 9

Re: [R] Xyplot or Tin-R problem?

2010-07-12 Thread David Winsemius
On Jul 12, 2010, at 6:26 PM, YANG, Richard ChunHSi wrote: I ran the following script from xyplot Examples using Tin-R on Windows and saw no plot produced. EE - equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data=ethanol, prepanel = function(x,y) prepanel.loess(x, y,

[R] Correct function name for text display of S4 object

2010-07-12 Thread Andrew Liu
Hello, I am working on an R package for storing order book data. I currently have a display method that has the following output (ob is an S4 object): display(ob) Current time is 09:35:02 Price Ask Size -- 11.42 900

[R] do the standard R analysis functions handle spatial grid data?

2010-07-12 Thread chris howden
Hi everyone, I'm doing a resource function analysis with radio collared dingos and GIS info. The ecologist I'm working with wants to send me the data in a 'grid format'...straight out of ARCVIEW GIS. I want to model the data using a GLM and maybe a LOGISTIC model as well. And I was planning on

Re: [R] do the standard R analysis functions handle spatial grid data?

2010-07-12 Thread Steve Taylor
Have a look at the Task View for spatial data... http://cran.ms.unimelb.edu.au/web/views/Spatial.html From: chris howden tall.chr...@yahoo.com.au To:r-help@r-project.org, r-sig-ecology-requ...@r-project.org Date: 13/Jul/2010 2:01p Subject: [R] do the standard R analysis functions handle

[R] Accessing files on password-protected FTP sites

2010-07-12 Thread Cliff Clive
Hello everyone, Is it possible to download data from password-protected ftp sites? I saw another thread with instructions for uploading files using RCurl, but I could not find information for downloading them in the RCurl documentation. I am using R 2.11 on a Windows XP 32-bit machine. Thanks

[R] SAS Proc summary/means as a R function

2010-07-12 Thread Roger Deangelis
Hi, I am new to R. I am trying to create an R function to do a SAS proc means/summary proc.means ( data=bsebal; class team year; var ab h; output out=BseBalAvg mean=; run;) I have a solution if I quote the

Re: [R] SAS Proc summary/means as a R function

2010-07-12 Thread Erik Iverson
On 07/12/2010 07:16 PM, Roger Deangelis wrote: Hi, I am new to R. I am trying to create an R function to do a SAS proc means/summary proc.means ( data=bsebal; class team year; var ab h; output out=BseBalAvg mean=;

Re: [R] Accessing files on password-protected FTP sites

2010-07-12 Thread Jeff Newmiller
There is a standard notation for passwords in urls ... see for example http://www.devx.com/tips/Tip/5604 Cliff Clive cliffcl...@gmail.com wrote: Hello everyone, Is it possible to download data from password-protected ftp sites? I saw another thread with instructions for uploading files using

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
I had tried that earlier and didn't work either, I probably have \Sexpr in the wrong place. See example: Column one header gets blank: \documentclass[11pt]{article} \usepackage{longtable,verbatim,ctable} \usepackage{longtable,pdflscape} \usepackage{fmtcount,hyperref} \usepackage{fullpage}

Re: [R] SAS Proc summary/means as a R function

2010-07-12 Thread RICHARD M. HEIBERGER
Please get a copy of R for SAS and SPSS Users *by* *Muenchen*, Robert A. http://www.springer.com/statistics/computanional+statistics/book/978-0-387-09417-5 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Xyplot or Tin-R problem?

2010-07-12 Thread RICHARD M. HEIBERGER
You missed FAQ 7.22 7.22 Why do lattice/trellis graphics not work? The most likely reason is that you forgot to tell R to display the graph. Lattice functions such as xyplot() create a graph object, but do not display it (the same is true of *ggplot2* graphics, and Trellis graphics in S-Plus).

Re: [R] Fast string comparison

2010-07-12 Thread Ralf B
I am asking this question because String comparison in R seems to be awfully slow (based on profiling results) and I wonder if perhaps '==' alone is not the best one can do. I did not ask for anything particular and I don't think I need to provide a self-contained source example for the question.

Re: [R] Fast string comparison

2010-07-12 Thread Hadley Wickham
strings - replicate(1e5, paste(sample(letters, 100, rep = T), collapse = )) system.time(strings[-1] == strings[-1e5]) # user system elapsed # 0.016 0.000 0.017 So it takes ~1/100 of a second to do ~100,000 string comparisons. You need to provide a reproducible example that illustrates

[R] cbind in for loops

2010-07-12 Thread jd6688
I have 30 files in the current directories, i would like to perform the cbind(fil1,file2,file3,file4file30) how could i do this in a for loop: such as: file2 - list.files(pattern=.out3$) for (j in file2) { cbind(j)...how to implement cbind here } Thanks.

Re: [R] make an model object (e.g. nlme) available in a user defined function (xyplot related)

2010-07-12 Thread Deepayan Sarkar
On Mon, Jul 12, 2010 at 2:51 AM, Jun Shen jun.shen...@gmail.com wrote: Dear all, When I construct an nlme model object by calling nlme(...)-mod.nlme, this object can be used in xyplot(). Something like xyplot(x,y,.. .. ind.predict-predict(mod.nlme) .. ) is working fine in

[R] boxplot on all the columns

2010-07-12 Thread jd6688
how to use boxplot on all the columns from he date frame instead of manually entering the columns like below bhtest1 - read.table(bhtest1.txt, header=TRUE) boxplot (bhtest1[,2], bhtest1[,3], bhtest1[, 4], bhtest1[,5], bhtest1[,6], bhtest1[,7]) please help, Thanks, -- View this

Re: [R] problem with comparisons for vectors

2010-07-12 Thread Joshua Wiley
This is also mentioned in FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Also if you search the R-help archives for 'precision' you can find a lot of threads discussing the issue in further depth. On Sun, Jul 11, 2010 at 9:02 PM, Wu

Re: [R] boxplot on all the columns

2010-07-12 Thread Tal Galili
Actually, boxplot (bhtest1) Should do what you want... Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com

Re: [R] cbind in for loops

2010-07-12 Thread Joshua Wiley
Hi, Assuming that you have read the files into R, and that their names (in R) are held in some object (e.g., 'file2'), then this works do.call(what = cbind, args = mget(x = file2, envir = .GlobalEnv) Here is a reproducible example: x1 - data.frame(x = 1:10) x2 - data.frame(y = 1:10) file.names

Re: [R] Interrupt R?

2010-07-12 Thread Prof Brian Ripley
On Sun, 11 Jul 2010, Spencer Graves wrote: Hi, Richard and Duncan: Thank you both very much. You provided different but workable solutions. 1. With Rgui 2.11.1 on Vista x64, the escape worked, but neither ctrl-c nor ctrl-C worked for me. Why did you expect them too?

Re: [R] apply is slower than for loop?

2010-07-12 Thread Liviu Andronic
On Fri, Jul 9, 2010 at 9:11 PM, Gene Leynes gleyne...@gmail.com wrote: I thought the apply functions are faster than for loops, but my most recent test shows that apply actually takes a significantly longer than a for loop.  Am I missing something? Check Rnews for an article discussing proper

Re: [R] apply is slower than for loop?

2010-07-12 Thread Allan Engelhardt
On 12/07/10 08:16, Liviu Andronic wrote: On Fri, Jul 9, 2010 at 9:11 PM, Gene Leynesgleyne...@gmail.com wrote: [...] Check Rnews for an article discussing proper usage of apply and for. Liviu I am guessing you are referencing @article{Rnews:Ligges+Fox:2008

Re: [R] interpretation of svm models with the e1071 package

2010-07-12 Thread manuel.martin
Thanks a lot for the reply, some comments below On 07/10/2010 04:11 AM, Steve Lianoglou wrote: Hi, On Fri, Jul 9, 2010 at 12:15 PM, manuel.martin manuel.mar...@orleans.inra.fr wrote: Dear all, after having calibrated a svm model through the svm() command of the e1071 package, is there a

  1   2   >