Re: [R] Using NLS with a Kappa function

2010-10-13 Thread dave fournier
Actually it just the parameterization that is causing trouble near k=0 let u = (x-z)/a then the problematic part of your function is (1- k*u)^(1/k) take the log to get log(1-k*u)/k = -(k*u +k^2*u^2/2 + ...)/k = -(u +k u^2/2 + ..) so your function is exp(-u - ku^2/2 - ...) and

[R] Local linear regression: where can I find kernels?

2010-10-13 Thread Philipp Kunze
Hi there, What I'm trying to do is to calculate the line coefficients of a local linear regression model by hand. I'm aware that there are many great packages out there that calculate the local expectation E(y|x) with local linear regression, but that's not what I need. I need the coefficients of

Re: [R] Program BFAST

2010-10-13 Thread Michael Bedward
Hello, Looking at the bfast help page is says that the output component of the returned object is a list where the elements correspond to results for each iteration of the fitting algorithm. Michael On 13 October 2010 15:58, CALEF ALEJANDRO RODRIGUEZ CUEVAS alejandro.rodriguez.cue...@gmail.com

Re: [R] lapply to subsets

2010-10-13 Thread Feng Li
Yes, that is what I what... Thanks. Feng On Wed, Oct 13, 2010 at 6:38 AM, Michael Bedward michael.bedw...@gmail.comwrote: Hello Feng, I think you just want this... lapply(A, function(x) apply(x[,,-c(1,2)], c(1,2), mean)) Michael On 13 October 2010 04:00, Feng Li feng...@stat.su.se

Re: [R] How do I tell whether two vectors are identical?

2010-10-13 Thread Łukasz Ręcławowicz
benchmark( + all_eq = {isTRUE(all.equal.numeric(x,y))}, + dfrm = {compare-data.frame(id-seq(1,43e3,1),x,y); + compare$id[compare$x!=compare$y]}, + int = {(compare$x!=compare$y)}, + slf = {differences-compare$id[compare$x!=compare$y]}, + replications=1000) test replications

[R] Boxplot has only one whisker

2010-10-13 Thread tom
Hello! I am using box plot and one of my boxes has only one whisker. How can I change this? Code: bp-c(2.7, 3.1, 3.5, 8.95) Methode1 - quantile(bp,type = 7) Methode2 - quantile(bp,type = 2) d-data.frame(Methode1,Methode2) boxplot(d,ylab = Beispiel 1,range = 1.5)

[R] Plot table as table

2010-10-13 Thread Joel
The subject says it all :). So I have a table and I want it do be ploted like a table so to say and cant find any function/package that dose it for me. Anyone know of one? //Joel -- View this message in context: http://r.789695.n4.nabble.com/Plot-table-as-table-tp2993270p2993270.html Sent

Re: [R] Boxplot has only one whisker

2010-10-13 Thread Ivan Calandra
Try with more data points?! You have only five points, the last one being considered as outlier. Note that boxplot() requires a numeric vector for specifying data from which the boxplots are to be produced! HTH Ivan Le 10/13/2010 09:50, tom a écrit : Hello! I am using box plot and one of

Re: [R] Plot table as table

2010-10-13 Thread Joshua Wiley
Seems like I must be missing something but ?plot specifically ?plot.table Is that not ploted like a table? If it is not, do you know of any examples we could look at? Cheers, Josh On Wed, Oct 13, 2010 at 1:00 AM, Joel joda2...@student.uu.se wrote: The subject says it all :). So I have a

[R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread elpape
Dear everyone, I would like to create a kite chart in which I plot densities (width of the vertical kites) in relation to sediment depth (on reversed y-axis) for 6 different locations (Distances from seep site, on x-axis on top of the plot). The dataset I would like to use is:

Re: [R] Plot table as table

2010-10-13 Thread Joel
It should look something like this (not at all relevant except the look) http://r.789695.n4.nabble.com/file/n2993297/tableR19.jpg -- View this message in context: http://r.789695.n4.nabble.com/Plot-table-as-table-tp2993270p2993297.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Plot table as table

2010-10-13 Thread Joshua Wiley
Oh, what about latex() in package Hmisc? Creating a table seems like more of a job for a typesetting program, conveniently R has great interfaces to many. You might also look at R2HTML and the ilk. On Wed, Oct 13, 2010 at 1:14 AM, Joel joda2...@student.uu.se wrote: It should look something

Re: [R] Plot table as table

2010-10-13 Thread baptiste auguie
Hi, grid.table in gridExtra might give you some inspiration. HTH, baptiste On 13 October 2010 10:14, Joel joda2...@student.uu.se wrote: It should look something like this (not at all relevant except the look) http://r.789695.n4.nabble.com/file/n2993297/tableR19.jpg -- View this message

[R] Data Gaps

2010-10-13 Thread dpender
R community, I am trying to write a code that fills in data gaps in a time series. I have no R or statistics background at all but the use of R is proving to be a large portion of my PhD research. So far my code identifies where and the number of new entries required but I do not know how to

[R] robust standard errors for panel data

2010-10-13 Thread Max Brown
Hi, I would like to estimate a panel model (small N large T, fixed effects), but would need robust standard errors for that. In particular, I am worried about potential serial correlation for a given individual (not so much about correlation in the cross section). From the documentation, it

Re: [R] Boxplot has only one whisker

2010-10-13 Thread tom
Ivan Calandra wrote: Try with more data points?! You have only five points, the last one being considered as outlier. Note that boxplot() requires a numeric vector for specifying data from which the boxplots are to be produced! But why is only one of the boxplots missing his whisker?

Re: [R] Plot table as table

2010-10-13 Thread Joel
Thx for the ideas will try them out. Have a wonderful day //Joel -- View this message in context: http://r.789695.n4.nabble.com/Plot-table-as-table-tp2993270p2993344.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread Michael Bedward
Hello Ellen, First up I think you can use reshape to get your data into a form that kiteChart will work with... # assuming your matrix or data.frame is called X Xwide - reshape(X, timevar=depth, idvar=distance, direction=wide) # replace NAs with 0 (don't think kiteChart likes NA) Xwide[

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread Michael Bedward
Oops, sorry, I left out a step in that last post After replace NAs with 0 in Xwide... # use distance col as row names rownames( Xwide ) - Xwide[ , 1 ] Xwide - Xwide[ , -1 ] kiteChart( Xwide ) On 13 October 2010 19:49, Michael Bedward michael.bedw...@gmail.com wrote: Hello Ellen, First up I

Re: [R] Boxplot has only one whisker

2010-10-13 Thread Ivan Calandra
Well, you don't use the same data for both. Type 2 and 7 give different values for the 25 and 75%, which correspond more or less to the box hinges. If you take a look at how the whiskers are defined (look at ?boxplot.stats): |coef| this determines how far the plot ‘whiskers’ extend out from

Re: [R] filled.contour: colour key decoupled from main plot?

2010-10-13 Thread Jim Lemon
On 10/12/2010 01:09 AM, Panos Hadjinicolaou wrote: Dear R colleagues, I am trying to plot some geophysical data as a filled contour on a continent map and so far the guidance from the R-help archives has been invaluable. The only bit that still eludes me is the colour key (legend) coming with

Re: [R] robust standard errors for panel data

2010-10-13 Thread Achim Zeileis
On Wed, 13 Oct 2010, Max Brown wrote: Hi, I would like to estimate a panel model (small N large T, fixed effects), but would need robust standard errors for that. In particular, I am worried about potential serial correlation for a given individual (not so much about correlation in the cross

Re: [R] Bootstrapping Krippendorff's alpha coefficient

2010-10-13 Thread Jim Lemon
On 10/12/2010 08:58 PM, Łukasz Ręcławowicz wrote: Hi, I don't know how to sample such data, it can't be done by row sampling as default method on matrix in boot. Function takes matrix and returns single coefficient. #There is a macro but I want use R :)

Re: [R] LME with 2 factors with 3 levels each

2010-10-13 Thread Ista Zahn
Hi Laura, If you want ANOVA output, ask for it! A general strategy that almost always works in R is to fit 2 models, one without the term(s) you want to test, and one with. Then use the anova() function to test them. (models must be nested, and in the lmer() case you need to use REML = FALSE).

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread elpape
Hello, I've attached the result I'v'e got by applying your code (thanks for this!), but I seem to have horizontal kites instead of vertical kites. I need to rotate the entire graph, so to speak.. I've tried using viewpoint (found it on some forum), but this only seems to work with lattice

[R] exponentiate elements of a whole matrix

2010-10-13 Thread Maas James Dr (MED)
I've tried hard to find a way to exponentiate each element of a whole matrix such that if I start with A A = [ 2 3 2 4] I can get back B B = [ 7.38 20.08 7.38 54.60] I've tried B - exp(A) but no luck. Thanks J === Dr. Jim Maas University of

Re: [R] exponentiate elements of a whole matrix

2010-10-13 Thread Barry Rowlingson
On Wed, Oct 13, 2010 at 11:51 AM, Maas James Dr (MED) j.m...@uea.ac.uk wrote: I've tried hard to find a way to exponentiate each element of a whole matrix such that if I start with A A = [ 2   3      2   4] I can get back B B = [ 7.38   20.08      7.38   54.60] I've tried B - exp(A)

Re: [R] exponentiate elements of a whole matrix

2010-10-13 Thread Berwin A Turlach
On Wed, 13 Oct 2010 11:51:39 +0100 Maas James Dr (MED) j.m...@uea.ac.uk wrote: I've tried hard to find a way to exponentiate each element of a whole matrix such that if I start with A A = [ 2 3 2 4] I can get back B B = [ 7.38 20.08 7.38 54.60] I've tried B

[R] How to fix error in the package 'rgenoud'

2010-10-13 Thread Wonsang You
Dear R user fellows, I would like to ask you about the package 'rgenoud' which is a genetic optimization tool. I ran the function 'genoud' with two variables to be minimized by the following command. result-genoud(fn,nvars=2,starting.values=c(0.5,0), pop.size=1000, max.generations=10,

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread Jim Lemon
On 10/13/2010 07:11 PM, elpape wrote: Dear everyone, I would like to create a kite chart in which I plot densities (width of the vertical kites) in relation to sediment depth (on reversed y-axis) for 6 different locations (Distances from seep site, on x-axis on top of the plot). The dataset I

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread Michael Bedward
Super ! An option for vertical plotting would be very nice. Michael On 13 October 2010 22:19, Jim Lemon j...@bitwrit.com.au wrote: On 10/13/2010 07:11 PM, elpape wrote: Dear everyone, I would like to create a kite chart in which I plot densities (width of the vertical kites) in relation

Re: [R] Lattice: arbitrary abline in multiple histograms

2010-10-13 Thread Dennis Murphy
Hi: David was on the right track... library(reshape) # for the melt() function below rnorm(100,5,3) - A rnorm(100,7,3) - B rnorm(100,4,1) - C df - melt(data.frame(A, B, C)) names(df)[1] - 'gp' histogram(~ value | gp, data=df, layout=c(3,1), nint=50, panel=function(x, ..., groups){

Re: [R] compare histograms

2010-10-13 Thread Dennis Murphy
Hi: This recent thread revealed that a package on R-forge for calculating earth movers distance is available: http://r.789695.n4.nabble.com/Measure-Difference-Between-Two-Distributions-td2712281.html#a2713505 HTH, Dennis On Tue, Oct 12, 2010 at 7:39 PM, Michael Bedward

Re: [R] Data Gaps

2010-10-13 Thread Dennis Murphy
Hi: Perhaps ?append for simple insertions... HTH, Dennis On Wed, Oct 13, 2010 at 1:24 AM, dpender d.pen...@civil.gla.ac.uk wrote: R community, I am trying to write a code that fills in data gaps in a time series. I have no R or statistics background at all but the use of R is proving

[R] Date Time Objects

2010-10-13 Thread dpender
I am trying to convert an array from numeric values back to date and time format. The code I have used is as follows; for (i in 0:(length(DateTime3)-1)) { DateTime3[i] - (strptime(start, %m/%d/%Y %H:%M)+ i*interval) where start - [1] 1/1/1981 00:00 However the created array

Re: [R] compare histograms

2010-10-13 Thread Michael Bedward
Ah, that's interesting. I'll have a look because it's bound to be better than my effort. Many thanks Dennis. Michael On 13 October 2010 22:36, Dennis Murphy djmu...@gmail.com wrote: Hi: This recent thread revealed that a package on R-forge for calculating earth movers distance is available:

Re: [R] Lattice: arbitrary abline in multiple histograms

2010-10-13 Thread Alejo C.S.
Thanks all, works perfect. Alejo 2010/10/13 Dennis Murphy djmu...@gmail.com Hi: David was on the right track... library(reshape) # for the melt() function below rnorm(100,5,3) - A rnorm(100,7,3) - B rnorm(100,4,1) - C df - melt(data.frame(A, B, C)) names(df)[1] - 'gp'

[R] arima

2010-10-13 Thread nuncio m
HI useRs, Is it required to remove mean before using ARIMA models thanks nuncio -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma Goa-403804 [[alternative HTML version deleted]]

Re: [R] vertical kites in KiteChart (plotrix)

2010-10-13 Thread elpape
Wow! Thanks! On 13 October 2010 13:23, mbedward [via R] ml-node+2993501-2047744113-199...@n4.nabble.comml-node%2b2993501-2047744113-199...@n4.nabble.com wrote: Super ! An option for vertical plotting would be very nice. Michael On 13 October 2010 22:19, Jim Lemon [hidden

Re: [R] LME with 2 factors with 3 levels each

2010-10-13 Thread Dennis Murphy
Hi: On Tue, Oct 12, 2010 at 8:59 PM, Laura Halderman lk...@pitt.edu wrote: Hello. I am new to R and new to linear mixed effects modeling. I am trying to model some data which has two factors. Each factor has three levels rather than continuous data. Specifically, we measured speech at

Re: [R] Data Gaps

2010-10-13 Thread dpender
Dennis, Thanks for that. The problem now is that I am trying to use it in a for loop. Based on the example before, 2 entries are required after H[3] as specified by O. The problem is that when inserting values the length of the array changes so I don't know how to tell the loop that. This is

[R] nnet help

2010-10-13 Thread Raji
Hi R-helpers , i am learning nnet package now.I have seen that the nnet can be used for regression and classification.Can you give me more insights on the other data mining and predictive techniques that the nnet package can be used for? If possible, can you send me links for sample datasets with

Re: [R] How to fix error in the package 'rgenoud'

2010-10-13 Thread Wonsang You
I have to make correction in my error message which I introduced in my original message. Sorry for my mistake. Finally, I had the following error message after running the function ' genoud'. Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) : non-finite

[R] Nonparametric MANCOVA using matrices

2010-10-13 Thread Niccolò Bassani
Dear R-users, is anybody aware of some package or routine to implement nonparametric Multivariate Analysis of Covariance (MANCOVA) using matrices instead of single variable names? I found something for parametric MANCOVA which still requires single variables to be used (ffmanova,vegan), but since

Re: [R] How to fix error in the package 'rgenoud'

2010-10-13 Thread Wonsang You
I have to make correction in my error message which I introduced in my original message. Sorry for my mistake. Finally, I had the following error message after running the function 'genoud'. Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) : non-finite

[R] RODBC: forcing a special column to be read in as character

2010-10-13 Thread RINNER Heinrich
Dear R-users, I am working with R version 2.10.1 and package RODBC Version: 1.3-2 under windows. Say I have a table testtable (in an Access data base), which has many different columns, among them a character column X with integer-like data as 0012345. Using sqlFetch, I'd like to assure that

Re: [R] Date Time Objects

2010-10-13 Thread Henrique Dallazuanna
Try this: sapply(0:(length(DateTime3)-1), function(i)as.character(strptime(start, %m/%d/%Y %H:%M) + i * interval)) On Wed, Oct 13, 2010 at 8:51 AM, dpender d.pen...@civil.gla.ac.uk wrote: I am trying to convert an array from numeric values back to date and time format. The code I have

[R] repeating a GAM across many factors

2010-10-13 Thread oc1
Hi there, I'm working on a biological dataset that contains up to 40 species and 100 sites each. The response variable is index (trend), dependent is year - each combination has an index for each year between 1994 and 2008 inclusive. So my input file is along the following lines: species, site,

[R] Problem to create a matrix polynomial

2010-10-13 Thread Ron_M
Dear all R users, I was trying to create a polymonial using the polynom() of PolynomF package. My problem is, if I pass coefficients as simple numerical values, it is working, but for matrix coefficient it is not. Here is my try: library(PolynomF) z - polynom() ## following is working p1 - 1-

Re: [R] Date Time Objects

2010-10-13 Thread dpender
Thanks Henrique, Do you have any idea why the first entry doesn't have the time as the start specified is 1/1/1981 00:00? Is it something to do with being at midnight? Doug -- View this message in context: http://r.789695.n4.nabble.com/Date-Time-Objects-tp2993524p2993640.html Sent from the

[R] bootstrap in pROC package

2010-10-13 Thread zhu yao
Dear useRs: I use pROC package to compute the bootstrap C.I. of AUC. The command was as follows: roc1-roc(all$D,all$pre,ci=TRUE,boot.n=200) However, the result was: Area under the curve: 0.5903 95% CI: 0.479-0.7016 (DeLong) Why the C.I. was computed by the Delong Method? Yao Zhu Department

Re: [R] Date Time Objects

2010-10-13 Thread Henrique Dallazuanna
Try this: sapply(0::(length(DateTime3)-1), function(i)format(strptime(start, %m/%d/%Y %H:%M) + i * interval, %Y-%m-%d %H:%M:%S)) On Wed, Oct 13, 2010 at 10:16 AM, dpender d.pen...@civil.gla.ac.uk wrote: Thanks Henrique, Do you have any idea why the first entry doesn't have the time as the

Re: [R] Boxplot has only one whisker

2010-10-13 Thread David Winsemius
On Oct 13, 2010, at 5:06 AM, Ivan Calandra wrote: Well, you don't use the same data for both. Type 2 and 7 give different values for the 25 and 75%, which correspond more or less to the box hinges. If you take a look at how the whiskers are defined (look at ? boxplot.stats): |coef| this

Re: [R] Date Time Objects

2010-10-13 Thread dpender
Perfect. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Date-Time-Objects-tp2993524p2993663.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Memory not mapped when using .C, problem in Mac but not in Linux

2010-10-13 Thread David
Hello, I am aware this may be an obscure problem difficult to advice about, but just in case... I am calling a C function from R on an iMac (almost shining: bought by my institution this year) and gives a memory not mapped error. Nevertheless, exactly the same code runs without problem in a

[R] R: robust standard errors for panel data

2010-10-13 Thread Millo Giovanni
Hello. In principle Achim is right, by default vcovHC.plm does things the Arellano way, clustering by group and therefore giving SEs which are robust to general heteroskedasticity and serial correlation. The problem with your data, though, is that this estimator is N-consistent, so it is

Re: [R] Data Gaps

2010-10-13 Thread Dennis Murphy
Hi: On Wed, Oct 13, 2010 at 5:31 AM, dpender d.pen...@civil.gla.ac.uk wrote: Dennis, Thanks for that. The problem now is that I am trying to use it in a for loop. Based on the example before, 2 entries are required after H[3] as specified by O. The problem is that when inserting values

[R] bwplot change whiskers position to percentile 5 and P95

2010-10-13 Thread Christophe Bouffioux
Dear R-community, Using bwplot, how can I put the whiskers at percentile 5 and percentile 95, in place of the default position coef=1.5?? Using panel=panel.bwstrip, whiskerpos=0.05, from the package agsemisc gives satisfaction, but changes the appearance of my boxplot and works with an old

[R] NA with lmList

2010-10-13 Thread FMH
Dear All,   I was trying to use the lmList function to get the lmList graphic but  have a problem creating the graphic.  My data has missing values and an error occurred  as stated below. ### library(nlme) a   schoolid spring score

Re: [R] NA with lmList

2010-10-13 Thread Phil Spector
Please take a look at the documentation for lmList regarding the na.action= argument. It should be a *function*, not TRUE or FALSE. For example, try lmList(score ~ childid | spring, data=a, na.action=na.omit) - Phil Spector

[R] strip month and year from MM/DD/YYYY format

2010-10-13 Thread Kurt_Helf
Greetings I'm having difficulty witht the strptime function. I can't seem to figure a way to strip month (name) and year and create separate columns from a column with MM/DD/ formatted dates. Can anyone help? Cheers Kurt ***

Re: [R] Pipeline pilot fingerprint package

2010-10-13 Thread Rajarshi Guha
On Tue, Oct 12, 2010 at 8:54 PM, Eric Hu eric...@gilead.com wrote: Hi, I am trying to see if I can use R to perform more rigorous regression analysis. I wonder if the fingerprint package is able to handle pipeline pilot fingerprints (ECFC6 etc) now. Currently no - does Pipeline Pilot out put

Re: [R] R: robust standard errors for panel data

2010-10-13 Thread max . e . brown
Thanks Giovanni and Achim! I will try out some of the things you suggested. Let's see how far I get :-) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] bwplot change whiskers position to percentile 5 and P95

2010-10-13 Thread David Winsemius
On Oct 13, 2010, at 10:05 AM, Christophe Bouffioux wrote: Dear R-community, Using bwplot, how can I put the whiskers at percentile 5 and percentile 95, in place of the default position coef=1.5?? Using panel=panel.bwstrip, whiskerpos=0.05, from the package agsemisc gives satisfaction,

[R] interaction contrasts

2010-10-13 Thread Kay Cichini
hello list, i'd very much appreciate help with setting up the contrast for a 2-factorial crossed design. here is a toy example: library(multcomp) dat-data.frame(fac1=gl(4,8,labels=LETTERS[1:4]), fac2=rep(c(I,II),16),y=rnorm(32,1,1)) mod-lm(y~fac1*fac2,data=dat) ## the

Re: [R] extract rows of a matrix

2010-10-13 Thread Greg Snow
newmat - oldmat[ c(rep(FALSE,19),TRUE), ] Or newmat - oldmat[ seq(20, nrow(oldmat), 20), ] -- 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

[R] overlaying multiple contour plots

2010-10-13 Thread Jeremy Olson
Dear All, I have 4 or 5 contour plots that I need to overlay. Currently they are maps showing hot and cold areas for specific elements. I would like to combine these plots into one map, where each color will correspond to a different element and you would be able to see the areas that each

Re: [R] Read Particular Cells within Excel

2010-10-13 Thread Greg Snow
I don't know of any tools that would do this generally (RODBC could do it if there were specific column names in the 1st row and a given column with information to identify the rows, but this seems unlikely from your description). A couple of possibilities: In Excel you can highlight the

[R] Pasting function arguments and strings

2010-10-13 Thread Manta
Dear R community, I am struggling a bit with a probably fairly simple task. I need to use some already existing functions as argument for a new function that I am going to create. 'dataset' is an argument, and it comprises objects named 'mean_test', 'sd_test', 'kurt_test' and so on. 'arg1' tells

Re: [R] Plot table as table

2010-10-13 Thread Greg Snow
Also look at textplot in the gplots package and addtable2plot in the plotrix package. -- 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-

Re: [R] overlaying multiple contour plots

2010-10-13 Thread David Winsemius
On Oct 13, 2010, at 11:44 AM, Jeremy Olson wrote: Dear All, I have 4 or 5 contour plots that I need to overlay. Currently they are maps showing hot and cold areas for specific elements. Providing paste-able examples is the standard way to present such problems. I would like to combine

Re: [R] Pasting function arguments and strings

2010-10-13 Thread Bert Gunter
If I understand you correctly, just arg2(arg1) will work fine...One of the nice features of R. Example: f - function(dat,fun=mean,...) { fun(dat, ...) ## ... allows extra arguments to fun } f( rnorm(10), trim=.05) ## trimmed mean x - 1:10 f(x, fun = max,na.rm=TRUE) Cheers, Bert On Wed,

Re: [R] Pasting function arguments and strings

2010-10-13 Thread Manta
Thaks for your quick reply Bert, although I doubt it works. The reason is that the names of the objects of the dataset, all end with the sufix '_test' and therefore I need to attach/paste/glue this suffix to the 'arg2' of the function. Any other idea? -- View this message in context:

Re: [R] Plotting Y axis labels within a loop

2010-10-13 Thread Steve Swope
Got it , thanks! From: David Winsemius [via R] [mailto:ml-node+2992845-2070125287-199...@n4.nabble.com] Sent: Tuesday, October 12, 2010 3:28 PM To: Steve Swope Subject: Re: Plotting Y axis labels within a loop On Oct 12, 2010, at 5:54 PM, Steve Swope wrote: When I plot y axis

Re: [R] Pasting function arguments and strings

2010-10-13 Thread Peter Langfelder
From what I read, you want something like this: myfunction-function(dataset,arg1,arg2) { func = match.fun(arg2) argument = dataset[, match(paste(arg1,_test, sep=), names(dataset))] result=func(argument) return(result) } On Wed, Oct 13, 2010 at 9:28 AM, Manta mantin...@libero.it wrote:

Re: [R] Pasting function arguments and strings

2010-10-13 Thread William Dunlap
Is this the sort of thing you are looking for? f - function(testName, dataset, ...) { + testFunc - match.fun(paste(testName, _test, sep=)) + testFunc(dataset, ...) + } m_test - function(x) the m test p_test - function(x) the p test f(m, 17) [1] the m test Bill Dunlap

Re: [R] Memory not mapped when using .C, problem in Mac but not in Linux

2010-10-13 Thread William Dunlap
This often happens when your C code uses memory that it did not allocate, particularly when it reads or writes just a little beyond the end of a memory block. On some platforms or if you are lucky there is unused memory between blocks of allocated memory and you don't see a problem. Other

[R] Extracting index in character array.

2010-10-13 Thread lord12
If I have a character array: list = c(A, B, C) how do I access the third element without doing list[3]. Can't I find the index of C using a particular function? -- View this message in context: http://r.789695.n4.nabble.com/Extracting-index-in-character-array-tp2994029p2994029.html Sent from

Re: [R] Extracting index in character array.

2010-10-13 Thread Christian Raschke
which(list==C) [1] 3 See ?which On 10/13/2010 11:56 AM, lord12 wrote: If I have a character array: list = c(A, B, C) how do I access the third element without doing list[3]. Can't I find the index of C using a particular function? -- Christian Raschke Department of Economics and

[R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Schwab,Wilhelm K
Hello all, I had a very strange looking problem that turned out to be due to unexpected (by me at least) format changes to one of my data files. We have a small lab study in which each run is represented by a row in a tab-delimited file; each row identifies a repetition of the experiment and

Re: [R] Read Particular Cells within Excel

2010-10-13 Thread Henrique Dallazuanna
Try this: library(RDCOMClient) xl - COMCreate(Excel.Application) wk - xl$Workbooks()$Open(Book1.xlsx) do.call(cbind, wk$Sheets(1)$Range(B50:C55)$Value()) On Tue, Oct 12, 2010 at 9:17 PM, Jeevan Duggempudi jdug...@yahoo.comwrote: Hello all, I have a business user who generates monthly

Re: [R] bootstrap in pROC package

2010-10-13 Thread Łukasz Ręcławowicz
Try: ci.auc(all$D,all$pre,m=b) 2010/10/13 zhu yao mailzhu...@gmail.com: Dear useRs: I use pROC package to compute the bootstrap C.I. of AUC. The command was as follows: roc1-roc(all$D,all$pre,ci=TRUE,boot.n=200) -- Miłego dnia __

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Albyn Jones
How about emacs? albyn On Wed, Oct 13, 2010 at 01:13:03PM -0400, Schwab,Wilhelm K wrote: Hello all, . Have any of you found a nice (or at least predictable) way to use OO Calc to edit files like this? If it insists on thinking for me, I wish it would think in 24 hour time and 4 digit

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Peter Langfelder
On Wed, Oct 13, 2010 at 10:13 AM, Schwab,Wilhelm K bsch...@anest.ufl.edu wrote: Hello all, I had a very strange looking problem that turned out to be due to unexpected (by me at least) format changes to one of my data files.  We have a small lab study in which each run is represented by a

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Marc Schwartz
On Oct 13, 2010, at 12:13 PM, Schwab,Wilhelm K wrote: Hello all, I had a very strange looking problem that turned out to be due to unexpected (by me at least) format changes to one of my data files. We have a small lab study in which each run is represented by a row in a tab-delimited

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Joshua Wiley
On Wed, Oct 13, 2010 at 10:13 AM, Schwab,Wilhelm K bsch...@anest.ufl.edu wrote: Hello all, I had a very strange looking problem that turned out to be due to unexpected (by me at least) format changes to one of my data files.  We have a small lab study in which each run is represented by a

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Schwab,Wilhelm K
Albyn, I'll look into it. In fact, I have a small book on it that I bought in my very early days of using Linux. I quickly found TeX Maker (for the obvious), Code::Blocks for C/C++ and I would not have started the move without a working Smalltalk (http://pharo-project.org/home). For editing

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Schwab,Wilhelm K
Peter, vi is *really* primitive =:0 R is a little late because I tend to do shape changes prior to invoking R. However, I could load tweak and re-save and then bring R back into it later. I never would have thought of it. Thanks! Bill From:

Re: [R] Pipeline pilot fingerprint package

2010-10-13 Thread Eric Hu
Hi Rajarshi, Here is a post I found from Pipeline pilot community help pages: https://community.accelrys.com/message/3466 Eric -Original Message- From: Rajarshi Guha [mailto:rajarshi.g...@gmail.com] Sent: Wednesday, October 13, 2010 7:52 AM To: Eric Hu Cc: r-help@r-project.org

[R] Coin Toss Simulation

2010-10-13 Thread Shiv
I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads 1 104 296 3101 So I do: d -data.frame(exp_num=c(1,2,3)); /* Just 3

Re: [R] Memory not mapped when using .C, problem in Mac but not in Linux

2010-10-13 Thread David
Thank you very much for your kind reply. I used gdb, and it returns a reason KERN_INVALID_ADDRESS on a very simple operation (obtaining the time step for a numerical integration). Please see bellow. But, um, I solved it by changing the function's arguments in the C code from unsigned long int to

[R] loop

2010-10-13 Thread Julia Lira
Dear all, I am trying to run a loop in my codes, but the software returns an error: subscript out of bounds I dont understand exactly why this is happenning. My codes are the following: rm(list=ls()) #remove almost everything in the memory set.seed(180185) nsim - 10 mresultx -

[R] Regular expression to find value between brackets

2010-10-13 Thread Bart Joosen
Hi, this should be an easy one, but I can't figure it out. I have a vector of tests, with their units between brackets (if they have units). eg tests - c(pH, Assay (%), Impurity A(%), content (mg/ml)) Now I would like to hava a function where I use a test as input, and which returns the units

Re: [R] Coin Toss Simulation

2010-10-13 Thread Dimitris Rizopoulos
try this: n - 3 data.frame(Exp = seq_len(n), Heads = rbinom(n, 200, 0.5)) I hope it helps. Best, Dimitris On 10/13/2010 7:28 PM, Shiv wrote: I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads

[R] Change global env variables from within a function

2010-10-13 Thread Jon Zadra
Hi, I've looked all over for a solution to this, but haven't had much look in specifying what I want to do with appropriate search terms. Thus I'm turning to R-help. In the process of trying to write a simple function to rename individual column names in a data frame, I ran into the

Re: [R] Coin Toss Simulation

2010-10-13 Thread Erik Iverson
Shiv wrote: I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads 1 104 296 3101 So I do: d -data.frame(exp_num=c(1,2,3)); /*

Re: [R] Change global env variables from within a function

2010-10-13 Thread Duncan Murdoch
On 13/10/2010 2:19 PM, Jon Zadra wrote: Hi, I've looked all over for a solution to this, but haven't had much look in specifying what I want to do with appropriate search terms. Thus I'm turning to R-help. In the process of trying to write a simple function to rename individual column

Re: [R] Memory not mapped when using .C, problem in Mac but not in Linux

2010-10-13 Thread William Dunlap
I don't know much about the iMac. R's .C() passes R-language integers as pointers to 32-bit ints. If your iMac is 64-bit and sizeof(long)==8 in your compiler (pretty common for 64-bit compilers but not so for Microsoft Windows compilers) then Long[0] will use the next 64 bits to make an

Re: [R] [OT] (slightly) - OpenOffice Calc and text files

2010-10-13 Thread Schwab,Wilhelm K
It will get a good look, as will gnumeric - thanks to all! Bill From: Albyn Jones [jo...@reed.edu] Sent: Wednesday, October 13, 2010 2:14 PM To: Schwab,Wilhelm K Subject: Re: [R] [OT] (slightly) - OpenOffice Calc and text files emacs shows you exactly

Re: [R] Regular expression to find value between brackets

2010-10-13 Thread Henrique Dallazuanna
Try this: replace(gsub(.*\\((.*)\\)$, \\1, tests), !grepl(\\(.*\\), tests), ) On Wed, Oct 13, 2010 at 3:16 PM, Bart Joosen bartjoo...@hotmail.com wrote: Hi, this should be an easy one, but I can't figure it out. I have a vector of tests, with their units between brackets (if they have

  1   2   >