Re: [R] apply mean to a three-dimension data

2011-03-25 Thread Patrick Hausmann
Hi, I think you could also use this way (via array, see http://r.789695.n4.nabble.com/apply-over-list-of-data-frames-td3057968.html) b - list() b[[1]] = matrix(1:4, 2, 2) b[[2]] = matrix(10:13, 2, 2) b[[3]] = matrix(20:23, 2, 2) b.a - array(unlist(b), dim=c(2, 2, 3)) (b.mean - apply(X = b.a,

[R] parallel processing for bridge and blasso

2011-03-25 Thread Emily Deomano
I'm running 10, 000 iterations each for the bridge and blasso. 3, 000 iterations roughly takes a week in a core-duo processor with 16GB RAM. I'll have access to a 6C processor machine and I came across the multicore package. Can I use multicore with the bridge and blasso function? That is,

[R] Bounding ellipse for any set of points

2011-03-25 Thread Andy Lyons
After a lot of effort I developed the following function to compute the bounding ellipse (also known a as minimum volume enclosing ellipsoid) for any set of points. This script is limited to two dimensions, but I believe with minor modification the algorithm should work for 3 or more

[R] a question on R optimization functions

2011-03-25 Thread Dajiang J. Liu
Dear All, I use nlminb or optim for maximizing likelihood functions. Sometimes, the parameter values happen to be NA, then the program will hang there and iterate forever without stopping. No error message will be produced. So I can not use error catch method such as try. Are there any

Re: [R] Storing user-defined R functions

2011-03-25 Thread David.Epstein
Thanks to everyone for writing. A well-known phenomenon in mathematics, statistics and/or complex computing is that everything one already knows feels trivial and easy. It's as though one is permanently climbing a vertical cliff-face, while, if you look back from where you've come, you see a level

Re: [R] Popularity of R, SAS, SPSS, Stata, Statistica, S-PLUS updated

2011-03-25 Thread Allan Engelhardt
Not R, but just to get the data (format is month year,week,count) to compare with your students' output: perl -MLWP::UserAgent -e 'my $ua = LWP::UserAgent-new(); my $l = $ua-request(HTTP::Request-new(GET = qq{http://www.listserv.uga.edu/archives/sas-l.html}))-content(); while ( $l =~

[R] two plots in qplot

2011-03-25 Thread Denis Kazakiewicz
Hello I simply want to plot two variables against one 'year' variable in qplot. Is any way of doing this without reshaping data in long format and using facet function afterwards? Thank you Denis __ R-help@r-project.org mailing list

[R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Hi to all, how could I to rotate automatically a data sheet which was imported by read.xls? x1 x2 x3 xn y1 1 4 7 ... xn/y1 y2 2 5 8 xn/y2 y3 3 6 9xn/y2 yn ... ... ... Xn/Yn to y1 y2 y3 yn x1 1 23 . Yn/x1 x2 4 5

Re: [R] Storing user-defined R functions

2011-03-25 Thread Duncan Murdoch
On 11-03-25 4:05 AM, David.Epstein wrote: Thanks to everyone for writing. A well-known phenomenon in mathematics, statistics and/or complex computing is that everything one already knows feels trivial and easy. It's as though one is permanently climbing a vertical cliff-face, while, if you look

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Philipp Pagel
On Fri, Mar 25, 2011 at 11:43:31AM +0100, Knut Krueger wrote: Hi to all, how could I to rotate automatically a data sheet which was imported by read.xls? x1 x2 x3 xn y1 1 4 7 ... xn/y1 y2 2 5 8 xn/y2 y3 3 6 9xn/y2 yn ... ... ... Xn/Yn to

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 12:31, schrieb Philipp Pagel: If all the columns (x) are of the same type (e.g. all numeric) you can use t(). Example: Unfortunately we have mixed types f.e text , dates times , and numbers Knut __ R-help@r-project.org mailing list

Re: [R] Popularity of R, SAS, SPSS, Stata, Statistica, S-PLUS updated

2011-03-25 Thread Mike Marchywka
Date: Fri, 25 Mar 2011 09:40:39 + From: all...@cybaea.com To: muenchen@gmail.com CC: frien...@yorku.ca; had...@rice.edu; r-h...@stat.math.ethz.ch Subject: Re: [R] Popularity of R, SAS, SPSS, Stata, Statistica, S-PLUS updated Not R,

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Philipp Pagel
Unfortunately we have mixed types f.e text , dates times , and numbers OK - in that case you can't fit the data into data.frame. Possibley you cold get what you need using some kind of list structure but I think it's better to ask why you need to transpose the data. Maybe someone can suggest an

Re: [R] a question on R optimization functions

2011-03-25 Thread Ben Bolker
Dajiang J. Liu dajiang.liu at gmail.com writes: I use nlminb or optim for maximizing likelihood functions. Sometimes, the parameter values happen to be NA, then the program will hang there and iterate forever without stopping. No error message will be produced. So I can not use error catch

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 12:56, schrieb Philipp Pagel: OK - in that case you can't fit the data into data.frame. Possibley you cold get what you need using some kind of list structure but I think it's better to ask why you need to transpose the data. we have (imported from excel) frame -

[R] Appending data to a data.frame and writing a csv

2011-03-25 Thread Vincy Pyne
Dear R helpers exposure - data.frame(id = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), ead = c(9483.686,5,6843.4968,10509.37125,21297.8905,5,706152.8354, 62670.5625, 687.801995,50641.4875,59227.125,43818.5778,52887.72534,601788.7937,

Re: [R] Tukey HSD test using Multcomp

2011-03-25 Thread Mark Difford
Mar 25, 2011; 12:58am Simon Bate wrote: I've been happily using the TukeyHSD function to produce Tukeys HSD tests but have decided to try out Multcomp instead. However when I carry out the test repeatedly I have found that Multcomp produces slightly different values each time. (see code

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-25 Thread JP
Hi there David, Many thanks for your time and reply I created a small test set, and ran your proposed solution... and this is what I get http://i.imgur.com/vlsSQ.png This is not what I want - I want separate grp_1 and grp_2 panels and in each panel a red violin plot and a blue one. So like this

Re: [R] factor with numeric names

2011-03-25 Thread agent dunham
Dear all, According to the post I was trying: factorA = c(2,2,3,3,4,4,3,4,2,2) levels(factor - c(lv1,lv2,lv3) ) But this returns NULL and doesn't change factor names. Actually, my factor is included in a data.frame, so I also tried: levels(df$factorA)[levels(df$factorA)==2] - lv1 Also

Re: [R] questions regarding stat_smooth in ggplot area plot

2011-03-25 Thread Werner Heijstek
Hi Dennis, Thanks a lot for your insights. I 'solved' the negative smooth by not using an xlim() but an ylim(). If I may, I'll ask a third question: How to plot multiple of these ggplot area plots on top of one another so that the same x-axis is shared? vp.layout - function(x, y)

Re: [R] Seemingly unrelated regressions

2011-03-25 Thread Paul-Igor Ablo HOUNZANDJI
Hello, Can you help me getting some implementation of NSUR (Nonlinear Seemingly Unrelated Regression) in R ? Thanks. Paul-Igor. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Removing object - searching/googlin' ..and more hasn't helped :(

2011-03-25 Thread agustgisla
I know this is probably really easy thing but... I've loaded data into R from the net. I've got 97 subjects (in a database). I'm supposed to remove subjects lower than 140 cm.. Of course it's easy to find the subject (i.e. number 83 and 84) - but how can I delete these subjects from the database

[R] extracting partial residuals of each level of an interaction in a Mixed GAM

2011-03-25 Thread Amparo Lazaro
Hi, I'm using the library mgcv to fit Mixed effect GAM (gamm). My model is simple but account for an interaction between a factor and a continuous covariate. This is an example of my model: mymodel-gamm(visrate ~ factor(ExClutrEat)+s(logplantdiv,k=3, by=E)+s(logplantdiv,k=3, by=C)

Re: [R] Removing object - searching/googlin' ..and more hasn't helped :(

2011-03-25 Thread agustgisla
Well, nut = not if someone was wondering.. however I am getting nut...s! :) -- View this message in context: http://r.789695.n4.nabble.com/Removing-object-searching-googlin-and-more-hasn-t-helped-tp3405106p3405113.html Sent from the R help mailing list archive at Nabble.com.

[R] A question on glmnet analysis

2011-03-25 Thread 細田弘吉
Hi, I am trying to do logistic regression for data of 104 patients, which have one outcome (yes or no) and 15 variables (9 categorical factors [yes or no] and 6 continuous variables). Number of yes outcome is 25. Twenty-five events and 15 variables mean events per variable is much less than 10.

[R] applying random functions to multisets

2011-03-25 Thread zbynek.jano...@gmail.com
Hi, I am solving following problem: Suppose I have some multiset: multiset - c(a,a,c,d,d) and rules, which operate with it (for simplicity not writen in R functions) rule1: a - c(a,b) rule2: a - c(a,c) rule3: c - c(c,c) ... ruleX: ... I want to apply rules to multiset in maximaly parallel

Re: [R] factor with numeric names

2011-03-25 Thread agent dunham
Dear all, According to the post I was trying: factorA = c(2,2,3,3,4,4,3,4,2,2) levels(factorA - c(lv1,lv2,lv3) ) But this returns NULL and doesn't change factor names. Actually, my factor is included in a data.frame, so I also tried: levels(df$factorA)[levels(df$factorA)==2] - lv1 Also

Re: [R] Merging graphs with common nodes

2011-03-25 Thread ssamberkar
Hi Gabor, Thanks a lot for your help! Those graph functions worked smoothly. I had to only change the flag allow.duplicates=TRUE in safer.merge function. I have another issue. Does the write.graph function support the xml or graphml format to write graphs? That way these graphs are easier to

Re: [R] Merging graphs with common nodes

2011-03-25 Thread ssamberkar
Hi Gabor, Thanks a lot for your help! Those graph functions worked smoothly. I had to only change the flag allow.duplicates=TRUE in safer.merge function. I have another issue. Does the write.graph function support the xml or graphml format to write graphs? That way these graphs are easier to

[R] multiple plots with QQplot of PerformanceAnalytics

2011-03-25 Thread William Mok
Hi All, I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = c(...)); with the function QQplot from the package PerformanceAnalytics. The problem is that, no matter what order I use, it only plots 3 graphs on to 1 page and the last QQplot is shunted to the next page.

Re: [R] Removing object - searching/googlin' ..and more hasn't helped :(

2011-03-25 Thread Ben Bolker
agustgisla agg26 at hi.is writes: I know this is probably really easy thing but... I've loaded data into R from the net. I've got 97 subjects (in a database). I'm supposed to remove subjects lower than 140 cm.. Of course it's easy to find the subject (i.e. number 83 and 84) - but how can I

Re: [R] multiple plots with QQplot of PerformanceAnalytics

2011-03-25 Thread Joshua Ulrich
Please don't cross-post. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Mar 25, 2011 at 8:33 AM, William Mok wwl_...@yahoo.co.uk wrote: Hi All, I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = c(...)); with the function QQplot from the package

Re: [R] A question on glmnet analysis

2011-03-25 Thread Nick Sabbe
I haven't read all of your code, but at first read, it seems right. With regard to your questions: 1. Am I doing it correctly or not? Seems OK, as I said. You could use some more standard code to convert your data to a matrix, but essentially the results should be the same. Also, lambda.min may

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Philipp Pagel
we have (imported from excel) frame - data.frame(x0=c(y1,y2,y3,y4),x1=c(1,2,3,4),x2=c(5,6,7,8),x1=c(9,10,11,12)) where y1..yn are the names of the rows we need frame$x1 .. . frame$xn and frame[1,] .. frame[n,] but the first column is no the rownames. if it is possible to rotate

[R] Magic Number Error Message

2011-03-25 Thread armstrwa
Hi all, When I attempt to run a script, I keep getting the error message shown below. I have seen from searching that the Use of save versions prior to 2 is deprecated could be an error resulting from a permissions problem, but I have been unable to find anything describing the file has magnic

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Philipp Pagel
I am not 100% sure I understood what you intend to do but I think what you are saying is that you would like to address certain rows by name rather than by index. Is that correct? If so you could solve it like this: # assign the desired row names rownames(frame) = frame[,1] # remove the

Re: [R] two plots in qplot

2011-03-25 Thread Ista Zahn
Hi Denis, Yes, just specify the variables in an aes call inside your geom_* call. Hard to be more specific without an example... Best, Ista On Fri, Mar 25, 2011 at 1:24 AM, Denis Kazakiewicz d.kazakiew...@gmail.com wrote: Hello I simply want to plot two variables against one 'year' variable in

Re: [R] Magic Number Error Message

2011-03-25 Thread Philipp Pagel
On Fri, Mar 25, 2011 at 06:42:49AM -0700, armstrwa wrote: When I attempt to run a script, I keep getting the error message shown load(H:\\Restoration Center\\Climate Change and Restoration\\MidAtlFloodRisk\\discharge data\\R files\\ALRT.txt) Error: bad restore file magic number (file may

Re: [R] using R variables in RMySQL query

2011-03-25 Thread Uwe Ligges
On 23.03.2011 17:44, algotr8der wrote: I have the following function myGetstockdataMySQL- function(startdate, enddate, ticker) { con- dbConnect(MySQL(), user=blahblah, password=blahblah, dbname=blahblah, host=localhost) rs- dbGetQuery(con, SELECT price.close FROM price INNER JOIN stocks ON

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 8:49 AM, Knut Krueger wrote: Am 25.03.2011 12:56, schrieb Philipp Pagel: OK - in that case you can't fit the data into data.frame. Possibley you cold get what you need using some kind of list structure but I think it's better to ask why you need to transpose the data.

Re: [R] factor with numeric names

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 8:30 AM, agent dunham wrote: Dear all, According to the post I was trying: factorA = c(2,2,3,3,4,4,3,4,2,2) levels(factorA - c(lv1,lv2,lv3) ) Well, this is wrong. Try: levels(factorA) - c(lv1,lv2,lv3) factorA [1] 2 2 3 3 4 4 3 4 2 2 attr(,levels) [1] lv1 lv2 lv3

Re: [R] a question on R optimization functions

2011-03-25 Thread Ravi Varadhan
You might want to use `trace' and/or other debugging options to better understand when and why this happens. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine

Re: [R] two plots in qplot

2011-03-25 Thread Denis Kazakiewicz
Dear Ista Thank you very much for your time and suggestion Right now I am trying to study trends in drugs sales which can be reduced to the following example drug1 drug2 year 4 4 1 8 5 2 6 9 3 I want to draw plot with two lines in it were 'year' would

Re: [R] a question on R optimization functions

2011-03-25 Thread Paul Gilbert
It seems more likely that the return value from your function is NA or NaN or Inf. This might then result in an NA parameter value being calculated for the next step. This is possible, for example, because the line search extends outside the feasible region. You can re-write your function to

Re: [R] Magic Number Error Message

2011-03-25 Thread armstrwa
lt;!DOCTYPE html PUBLIC quot;-//W3C//DTD HTML 4.01 Transitional//ENquot;gt; Thanks, Philipp.  That helped a lot.  I have run into another problem now though. I am running the script, and some of it seems to work, but it outputs all NAs for the data and I get 50+ error warnings

Re: [R] Appending data to a data.frame and writing a csv

2011-03-25 Thread Ista Zahn
Hi Vincy, Please read the help file, particularly the part about write.csv and write.csv2 where it says These wrappers are deliberately inflexible: they are designed to ensure that the correct conventions are used to write a valid file. Attempts to change append, col.names, sep, dec or qmethod are

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-25 Thread David Winsemius
OK, I did it , but it required a minor hack to panel.violin, since in its native state panel.violin only passes a single vector the the grid plotting functions. On Mar 25, 2011, at 6:29 AM, JP wrote: Hi there David, Many thanks for your time and reply I created a small test set, and ran

Re: [R] two plots in qplot

2011-03-25 Thread Ista Zahn
Hi Denis, On Fri, Mar 25, 2011 at 10:33 AM, Denis Kazakiewicz d.kazakiew...@gmail.com wrote: Dear Ista Thank you very much for your time and suggestion Right now I am trying to study trends in drugs sales which can be reduced to the following example drug1   drug2   year 4       4       1

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-25 Thread David Winsemius
Using that hack you can also skip the trellis.par.set step with an internal assignment of color: bwplot(r ~ p | q, col=c(yellow, green), data=test_data, panel = function(x,y, subscripts, col=col, ..., box.ratio){ panel.violin.hack(x,y,

Re: [R] Appending data to a data.frame and writing a csv

2011-03-25 Thread Vincy Pyne
Dear Mr Ista Zahn, Thanks a lot for your suggestion. I had also realized that if I need to write.csv command should be out of loop. At first, I need to construct the data.frame. Actually appending this data.frame is causing me the problem and not writing the csv file. That particular command

Re: [R] Magic Number Error Message

2011-03-25 Thread jim holtman
This is where you start to learn to debug scripts and to use the 'browser' function. Type in the following: options(warn = 2, error = utils::recover) This will turn warnings into errors and stop on the statement that caused the error and invoke the browser so you can check the values of

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 14:51, schrieb Philipp Pagel: The frame$y2 notation still only works for columns, of course. Maybe, if you tell us some more about your actual analysis, more help can be provided. Thank,s but the only question was to use a common notation like for columns if the excel sheet

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Kenn Konstabel
Hi Knut, On Fri, Mar 25, 2011 at 10:43 AM, Knut Krueger r...@knut-krueger.de wrote: Hi to all, how could I  to rotate automatically a data sheet which was imported by read.xls?     x1 x2 x3 xn y1 1   4  7   ...  xn/y1 y2 2   5  8   xn/y2 y3 3   6  9    xn/y2 yn ... ... ...  

[R] linear constrained optimization in R

2011-03-25 Thread sammyny
I am trying to use http://rss.acs.unt.edu/Rdoc/library/stats/html/constrOptim.html in R to do optimization in R with some given linear constraints but not able to figure out how to set up the problem. For example, I need to maximize $f(x,y) = log(x) + \frac{x^2}{y^2}$ subject to constraints

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Bert Gunter
It does not appear to have been clearly noted in this thread that one CANNOT rotate a data frame. Data frames are designed to contain mixed types in their columns, which means that to rotate the frame, the rows would have to be coerced to a single type, thereby most likely losing the information.

[R] Finding the common portion of strings

2011-03-25 Thread Dennis Fisher
Colleagues R: 2.12.2 OS X I have a set of text objects in the form (I am showing 3 of what is more likely to be 20 or so): OBJECTS - c(abcSOMETHINGCOMMONegf, xSOMETHINGCOMMONyz, SOMETHINGCOMMONnme) As you can see, all contain SOMETHINGCOMMON and the position varies. But, I don't

Re: [R] Finding the common portion of strings

2011-03-25 Thread Henrique Dallazuanna
Try this: intersect2 - function (x, y) { y - as.vector(y) y[match(as.vector(x), y, 0L)] } paste(Reduce(intersect2, strsplit(OBJECTS, NULL)), collapse = '') On Fri, Mar 25, 2011 at 2:27 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues R: 2.12.2 OS X I have a set of text

Re: [R] Finding the common portion of strings

2011-03-25 Thread Bert Gunter
Define: common string of characters for: x - abcdghi y - abcghi z - ghiabc u - abghabc -- Bert On Fri, Mar 25, 2011 at 10:34 AM, Henrique Dallazuanna www...@gmail.com wrote: Try this: intersect2 - function (x, y) {    y - as.vector(y)    y[match(as.vector(x), y, 0L)] }

[R] hacking lattice::panel.violin was Re: Colour makes my life; but not my bwplot (panel.violin)

2011-03-25 Thread David Winsemius
I don't really know. I'm not at Deepayan's level by any stretch of the imagination. When I was reading the help pages and reading archive postings regarding bwplot/violin it seemed that Deepayan thought the groups arguments for those functions were not as he would have desired. I noted

[R] C-statistics (AUCs) from rcorr.cens or survcomp time-dependent ROC curves

2011-03-25 Thread North, Bernard V
I am using the rcorr.cens function from the Hmisc package and the time-dependent ROC curve obtained using tdrocc in the survcomp package. I understand that the C statistic from rcorr.cens has to be subtracted from 1 if high values of the risk variable lower survival. Given that I wonder what

[R] Likelihood of deviation

2011-03-25 Thread Michael Hecker
Hi, I have a dataset of 78.903 news articles pertaining to 340 corporate takeovers. Mean 231.3871 [articles per takeover] Std. Dev. 673.6395 I would like to calculate the probability of a certain number of news articles if I had more takeovers available. How likely is it to have X articles

[R] extract MSS from a lme model

2011-03-25 Thread Rosario Garcia Gil
Hello I am using a mixed model (lme Model- height ~ site + family + site*family) and I would like to estimate the additive variance (Vf) for which I need the MSS. When I carry out the Anova I do not get the MSS. Could someone explain me why? Thanks in advance. /R

Re: [R] Insert rows into a pre-existing data frame

2011-03-25 Thread Mark Brewster
Also, modified from Prof Brian Ripley's post https://stat.ethz.ch/pipermail/r-devel/2006-July/038551.html here , idx- 2 df3- df1[c(1:idx,idx,(idx+1):nrow(df1)),] df3 df3[idx+1,]- NA #or whatever values you want df3 -- View this message in context:

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-25 Thread JP
Are you going to include this in the main source? Surely this is something people must need/ask for... On 25 March 2011 16:14, David Winsemius dwinsem...@comcast.net wrote: Using that hack you can also skip the trellis.par.set step with an internal assignment of color: bwplot(r ~ p | q,

[R] for loop assistance -

2011-03-25 Thread Steven Ranney
All – I have an example data frame x lc1 id 43.38812035 85 ga1 47.55710661 85 ga1 47.55710661 85 ga2 47.55710661 85 ga2 51.99211429 85 ga3 51.99211429 85 ga3 51.99211429 95 ga1 54.78449958 95 ga1 54.78449958 95

[R] Matching package - Match function

2011-03-25 Thread sunny
Hi. I am using the Matching package for propensity score matching. For each treated unit, I want to find all control units whose propensity scores lie within a certain distance from the treated unit. The sample code is as follows: library(Matching) x - rnorm(10) y - rnorm(10) z -

Re: [R] for loop assistance -

2011-03-25 Thread Henrique Dallazuanna
Try this: aggregate(x ~ lc1 + id, DF, FUN = mean) Where DF is your data.frame On Fri, Mar 25, 2011 at 2:36 PM, Steven Ranney steven.ran...@gmail.com wrote: All – I have an example data frame x       lc1     id 43.38812035     85      ga1 47.55710661     85      ga1 47.55710661     85    

Re: [R] for loop assistance -

2011-03-25 Thread Jorge Ivan Velez
Hi Steven, One would be with(yourdataset, aggregate(x, list(lc1, id), mean)) Group.1 Group.2x 1 85 ga1 45.47261 2 95 ga1 53.38831 3 105 ga1 58.18282 4 115 ga1 63.77469 5 125 ga1 66.98222 6 85 ga2 47.55711 7 95 ga2

Re: [R] Likelihood of deviation

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 12:17 PM, Michael Hecker wrote: Hi, I have a dataset of 78.903 news articles pertaining to 340 corporate takeovers. Mean 231.3871 [articles per takeover] Std. Dev. 673.6395 I would like to calculate the probability of a certain number of news articles if I had more

Re: [R] a question on R optimization functions

2011-03-25 Thread Ben Bolker
Paul Gilbert pgilbert at bank-banque-canada.ca writes: It seems more likely that the return value from your function is NA or NaN or Inf. This might then result in an NA parameter value being calculated for the next step. This is possible, for example, because the line search extends

[R] spatial stats - geoR - variogram - standard deviation

2011-03-25 Thread Sean Parks
Hello, I am attempting to get the standard deviation in multiple distance bins in my spatial data. It appears as though the 'variog' command in the geoR package will do the trick, as one of the outputs from 'variog' is 'variog$sd', which, according to the manual, is the standard deviation of

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Pam Allen
Hello Baptiste and others, I tried your example with my dataset, and for a few days I thought it worked for me. But I realized yesterday that the result wasn't quite what I hoped for. In my actual data the flows aren't perfectly sinusoidal, and I used a series of ifelse queries to code the

Re: [R] extracting file names

2011-03-25 Thread MacQueen, Don
While I think David's suggestion is better, because it's more readable, this should also work: dat - read.table(file.name - file.choose(), header = FALSE) Note the assignment inside the function call. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 3:23 PM, Pam Allen wrote: Hello Baptiste and others, I tried your example with my dataset, and for a few days I thought it worked for me. But I realized yesterday that the result wasn't quite what I hoped for. In my actual data the flows aren't perfectly sinusoidal,

Re: [R] Finding the common portion of strings

2011-03-25 Thread Gabor Grothendieck
On Fri, Mar 25, 2011 at 1:27 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues R: 2.12.2 OS X I have a set of text objects in the form (I am showing 3 of what is more likely to be 20 or so):        OBJECTS - c(abcSOMETHINGCOMMONegf, xSOMETHINGCOMMONyz, SOMETHINGCOMMONnme) As

Re: [R] a question on R optimization functions

2011-03-25 Thread Ravi Varadhan
Ben, I am a huge fan of the old-fashioned and low-tech `cat'; it is good to know that I am not alone in this! Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins

[R] Neutral sources that attest to the success of the R project?

2011-03-25 Thread Tal Galili
Hello everyone, The R (programming language) article in Wikipedia was nominated as a Engineering and technology good article but did *not* meet the good article criteria at the time (2010). The reviewer at the time made two interesting comments about the article: - Sources are almost all

Re: [R] Finding the common portion of strings

2011-03-25 Thread Gabor Grothendieck
On Fri, Mar 25, 2011 at 4:47 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Mar 25, 2011 at 1:27 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues R: 2.12.2 OS X I have a set of text objects in the form (I am showing 3 of what is more likely to be 20 or so):        

[R] World plots and clipping regions

2011-03-25 Thread Saptarshi Guha
Hello, Given the following display library(maps) library(mapproj) m - map('world',plot=FALSE) map('world',proj='mollweide',bg=bgcolor[2],col='white') map.grid(col=2,lim=c(-175,-175,-180,180),label=FALSE,lty=2) Is there a way to color the region outside the dotted red border? Thank you

[R] Preserving the class of POSIXt objects

2011-03-25 Thread Kenn Konstabel
Dear all, I am working with a list of objects each of which contains two POSIXct objects (say, $Start and $End) and a number of different data in addition to that. Now an easy way to extract Start times of all object could be sapply(x, [, Start) but this converts them all to numeric, and so does

Re: [R] Preserving the class of POSIXt objects

2011-03-25 Thread David Wolfskill
On Fri, Mar 25, 2011 at 09:14:50PM +, Kenn Konstabel wrote: Dear all, I am working with a list of objects each of which contains two POSIXct objects (say, $Start and $End) and a number of different data in addition to that. Now an easy way to extract Start times of all object could be

Re: [R] Preserving the class of POSIXt objects

2011-03-25 Thread Jeff Newmiller
library(plyr) ldply(x,function(v){data.frame(Start=v$Start,End=v$End)}) --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research

[R] library(foreign) read.spss warning

2011-03-25 Thread Robert Baer
I got the following: library(foreign) swal = read.spss(swallowing.sav, to.data.frame =TRUE) Warning message: In read.spss(swallowing.sav, to.data.frame = TRUE) : swallowing.sav: Unrecognized record type 7, subtype 21 encountered in system file The bulk of the data seems to read in a

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Pam Allen
Hello again, I wrote an example that better represents my data, since the coloured points are actually consecutive, but with variable lengths: date=as.Date(c(1:300)) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c(high,med,low),100)) data=cbind.data.frame(date, flow, levels) library(zoo) z -

[R] Error: cannot allocate vector of size

2011-03-25 Thread mipplor
i run a model ,but i turn out to be like this. but i have run this model days ago and it works well whats going on here? any suggestion. model1‐siarmcmcdirichletv4(data,sources,tef,concdep=0,50,5) Error: cannot allocate vector of size 2.2 Gb In addition: Warning messages: 1: In

[R] to draw a too big clutering picture

2011-03-25 Thread wang peter
i did clustering on a data with 497 rows and 71 columns but the result picture is too big to display how can i display it partly this is the code: x-read.table(x,sep=,) dim(x) library(cluster) t-agnes(x) par(ask=T) plot(t) [[alternative HTML version deleted]]

Re: [R] error in bargraph.CI {sciplot}

2011-03-25 Thread barbara costa
Well, I have the R version 12.2.2 I installed sciplot_1.0-7.zip http://cran.r-project.org/bin/windows/contrib/r-release/sciplot_1.0-7.zip for windows. I have the Windows 7 in a HP laptop. I didn't modify anything. Just copied the examples script on bargraph.CI webpage to my R console

Re: [R] to draw a too big clutering picture

2011-03-25 Thread Peter Langfelder
On Fri, Mar 25, 2011 at 2:57 PM, wang peter wng.pe...@gmail.com wrote: i did clustering on a data with 497 rows and  71 columns but the result picture is too big to display how can i display it partly this is the code: x-read.table(x,sep=,) dim(x) library(cluster) t-agnes(x) par(ask=T)

Re: [R] library(foreign) read.spss warning

2011-03-25 Thread Ista Zahn
There are many similar questions on R-help over the years, and in other places around the 'net. Try a google search. Best, Ista On Fri, Mar 25, 2011 at 7:39 PM, Robert Baer rb...@atsu.edu wrote: I got the following: library(foreign) swal = read.spss(swallowing.sav, to.data.frame =TRUE)

Re: [R] error in bargraph.CI {sciplot}

2011-03-25 Thread barbara costa
Here's my session info: sessionInfo() R version 2.12.2 (2011-02-25) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United Kingdom.1252 [2] LC_CTYPE=English_United Kingdom.1252 [3] LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United

Re: [R] error in bargraph.CI {sciplot}

2011-03-25 Thread barbara costa
Hi again, I opened a new worskpace and if this function is done before I do other things it works! But to use my data I'll have a problem. Thanks anyway. Barbara On 25 March 2011 23:51, barbara costa rbarbar...@gmail.com wrote: Here's my session info: sessionInfo() R version 2.12.2

Re: [R] error in bargraph.CI {sciplot}

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 8:06 PM, barbara costa wrote: Hi again, I opened a new worskpace and if this function is done before I do other things it works! But to use my data I'll have a problem. It sounds like you have a collision of some sort between package function names. Running just with

Re: [R] error in bargraph.CI {sciplot}

2011-03-25 Thread barbara costa
Well, I took some of my personal small functions that I was not using but was putting in my console in the beginning of the script and that finally worked! I don't know which function was, but if it happens again we can advise the person to that problem. thanks a lot. Barbara On 26 March 2011

[R] Does RHIPE support running complex mining models in on top of Hadoop?

2011-03-25 Thread Xiaobo Gu
Such as logistic regression, decision trees. Or is that RHIPE only support MapReduce style algorithms. Xiaobo Gu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Exporting columns into multiple files - loop query

2011-03-25 Thread WOOD, Matthew
Hi, I'm using a loop to extract 2 columns from an array into multiple files. I can use the following to export 3 files, containing column 'ID' with one of the three event columns. ID-c(A,B,C,D,E,F) event1-c(0,1,0,0,1,0) event2-c(1,1,0,1,0,0) event3-c(1,0,1,0,1,0)

Re: [R] Exporting columns into multiple files - loop query

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 10:45 PM, WOOD, Matthew wrote: Hi, I'm using a loop to extract 2 columns from an array into multiple files. I can use the following to export 3 files, containing column 'ID' with one of the three event columns. ID-c(A,B,C,D,E,F) event1-c(0,1,0,0,1,0)

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Jim Lemon
On 03/26/2011 07:19 AM, Pam Allen wrote: Hello again, I wrote an example that better represents my data, since the coloured points are actually consecutive, but with variable lengths: date=as.Date(c(1:300)) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c(high,med,low),100))