Re: [R] RMySQL and RMPI together

2010-07-20 Thread kdbondalapati
Jeff, Thank you for your response. Upon your suggestion, I sent the connection info to the slaves as: mpi.bcast.Robj2slave(sqlUser) mpi.bcast.Robj2slave(sqlPass) mpi.bcast.Robj2slave(sqlDBname) mpi.bcast.Robj2slave(sqlHost) and then inserted the following command in the slave task: con -

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-20 Thread Glen Barnett
Erk. Sorry about the wrapping issue on the comments in the code, which will interfere with a straight copypaste. Glen __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] sdmx reading/writing?

2010-07-20 Thread Albert-Jan Roskam
Hi,   I've been looking for a package that reads and/or writes in the sdmx statististical (meta)data format (http://sdmx.org/) but I couldn't find any. Does anybody know whether this is available? Cheers!! Albert-Jan ~~ All

[R] Transformation of Y changes the 'lm' object?

2010-07-20 Thread Shubha Vishwanath Karanth
Hi R, This is a problem, which I have tried to present in a simple way: Let, x1=1:10 x2=2:11 y=2+3*x1 lm_obj=lm(y~x1+x2) lm_obj step(lm_obj) # Step function for the first time y=y^0.1 lm_obj step(lm_obj) #Step function after a transformation on Y, but 'lm_obj' is not

Re: [R] Odp: Question from day2 beginner

2010-07-20 Thread maxcheese
It worked, thanks! -- View this message in context: http://r.789695.n4.nabble.com/Question-from-day2-beginner-tp2293221p2294986.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Reshaping data

2010-07-20 Thread Thomas Jensen
Hi Dennis, Thanks for the answer, it works perfectly for two time intervals, but if I add a third interval like this: ID begin_t1end_t1 begin_t2end_t2 begin_t3end_t3 Thomas 11/03/0413/05/0604/02/07

[R] implement a jackknife resampling test with size of each jackknife replicate controlled

2010-07-20 Thread Mao Jianfeng
Dear R-help listes, I need your helps on implementation a jackknife resampling test. For example, I have a sample of 100 observations. I need to calculate the mean by jackknife resampling test. I just intend to sample 75% of the whole sample (say 75 in this case) in each 100 times of jackknife

Re: [R] Question from day2 beginner

2010-07-20 Thread maxcheese
Thanks for the explanation! -- View this message in context: http://r.789695.n4.nabble.com/Question-from-day2-beginner-tp2293221p2294990.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Downloading data fron web

2010-07-20 Thread Megh Dal
Dear all, I need to download some data from this webpage: http://markets.ft.com/ft/markets/researchArchive.asp Notable thing here is that there are some fields to be selected to get the desired data. Is there any R facility to do this directly? Obviously I can do it manually and then just

[R] for loop

2010-07-20 Thread n.via...@libero.it
Dear list, I'm trying to run the following for loop: I have two list, the first one is $'5684' CFISCALE5684 RAGSOCBBrembo $'4532' CFISCALE4532 RAGSOCBStella which is this one in terms of dput: dput(kk) structure(list(`5684` = structure(c(5684, Brembo,

[R] Error in using matest function

2010-07-20 Thread shabnam k
Hi, While doing matest, i got errors like tis.Can u please help me in solving these errors. test.all = matest(madata, fit.full.mix, test.method=c(1,1), + shuffle.method=sample, term=Treatment,n.perm=100) Doing F-test on observed data ... Error in ma.svd(X, method = dgesvd) : infinite or

[R] Call to rgamma using .C causes R to hang

2010-07-20 Thread Steve Pederson
Hi, I've been trying to get this working for ages, but it causes R to hang. Here is my C code saved as test1.c # include R.h # include Rmath.h void test1 (double *x, double *result) { result[0] = rgamma(*x, 2.0); } This was compiled using R CMD SHLIB test1.c loaded in R using:

Re: [R] question about sign of probit estimates

2010-07-20 Thread peter dalgaard
On Jul 20, 2010, at 2:39 AM, Nita Umashankar wrote: Hello, I am getting some results from my Probit estimation in R that are in the opposite direction of what I hypothesized. In sas, the default is probability that y=0 (instead of 1) so one needs to type the word descending to get P(y=1).

Re: [R] Call to rgamma using .C causes R to hang

2010-07-20 Thread Berwin A Turlach
G'day Steve, On Tue, 20 Jul 2010 17:20:49 +0930 Steve Pederson stephen.peder...@adelaide.edu.au wrote: I suggest to insert the following two lines (untested as I usually don't work on Windows): # include R.h # include Rmath.h void test1 (double *x, double *result) { GetRNGstate();

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-20 Thread Dennis Murphy
Hi: This might be a little easier (?): library(datasets) skewness - function(x) mean(scale(x)^3) mean.gt.med - function(x) mean(x)median(x) # -- # construct the function to apply to each variable in the data frame f - function(x) c(mean = mean(x), sd = sd(x), skewness = skewness(x),

[R] apply: return list of matrices

2010-07-20 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Hi everybody, Suppose we have the following data structure: ddf -data.frame(a=rep(1:4,3), b=rep(paste(p, 1:3, sep=), each=4), c=c(1,0,0,1,1,1,0,1,1,1,1,1)) I want now to make a contingency table for each pair of values of p, i.e. a contingency table for each of the pairs (p1,p2), (p1,p3) and

Re: [R] Transformation of Y changes the 'lm' object?

2010-07-20 Thread Gavin Simpson
On Tue, 2010-07-20 at 13:16 +0530, Shubha Vishwanath Karanth wrote: Hi R, This is a problem, which I have tried to present in a simple way: Let, x1=1:10 x2=2:11 y=2+3*x1 lm_obj=lm(y~x1+x2) lm_obj step(lm_obj) # Step function for the first time y=y^0.1 lm_obj

Re: [R] apply: return list of matrices

2010-07-20 Thread Dimitris Rizopoulos
one approach is the following: ddf - data.frame(a = rep(1:4,3), b = rep(paste(p, 1:3, sep=), each=4), c = c(1,0,0,1,1,1,0,1,1,1,1,1)) sp - lapply(split(ddf$c, ddf$b), factor, levels = 0:1) combn(sp, 2, FUN = table, simplify = FALSE) I hope it helps. Best, Dimitris On 7/20/2010 11:29 AM,

[R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread StatWM
Dear R community, is there a way to get correct t- and p-values and R squared for linear regression models specified without an intercept? example model: summary(lm(y ~ 0 + x)) This gives too low p-values and too high R squared. Is there a way to correct it? Or should I specify with intercept

Re: [R] apply: return list of matrices

2010-07-20 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Works as expected, THX a lot. BR thorn -Original Message- From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] Sent: mardi 20 juillet 2010 11:41 To: Thaler,Thorn,LAUSANNE,Applied Mathematics Cc: r-help@r-project.org Subject: Re: [R] apply: return list of matrices one

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread StatWM
Let's assume x and y as stationary. It's not a spurious regression problem here. I think the function lm() has to have an intercept to give correct values of t- and p- and R squared. I wonder if you can correct the values in R though? -- View this message in context:

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread Arun.stat
What x and y represent? Are they non-stationary, trending? then you would get very high R2 (~97-99%) and very low p-value. Perhaps you land on the world of spurious regression. In this case forcing intercept to zero would not help you. Work with differenced series instead raw data. Thanks and

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread Dennis Murphy
Hi: On Tue, Jul 20, 2010 at 2:41 AM, StatWM wmus...@gmx.de wrote: Dear R community, is there a way to get correct t- and p-values and R squared for linear regression models specified without an intercept? example model: summary(lm(y ~ 0 + x)) This gives too low p-values and too high R

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread peter dalgaard
On Jul 20, 2010, at 11:41 AM, StatWM wrote: Dear R community, is there a way to get correct t- and p-values and R squared for linear regression models specified without an intercept? example model: summary(lm(y ~ 0 + x)) This gives too low p-values and too high R squared. Is there

Re: [R] Historical Libor Rates

2010-07-20 Thread Marshall Feldman
Hi AAditya, There's a great tool for searching the web, called Google. I used it to find the following web site when I entered historical libor rates for the search: http://www.wsjprimerate.us/libor/libor_rates_history.htm. The site came up as the first hit. I suggest you use the scrapeR

Re: [R] Call to rgamma using .C causes R to hang

2010-07-20 Thread Steve Pederson
Hi Berwin, Thanks for the help. That got it working. And you're right. I'm still struggling my way through trying to understand Section 5. http://cran.r-project.org/doc/manuals/R-exts.html#System-and-foreign-language-interfaces Cheers, Steve Berwin A Turlach wrote: G'day Steve, On Tue,

[R] integrate of function f(x,y,z) respect to x only

2010-07-20 Thread Xin Shi
Dear: Anyone has experience to use R integrate a function with more than two dimensions, but you only need to integrate the function respect to one variable, say x. Because I also want to maximise the log-likelihood after integration of function respect to x. Thanks! Xin --- Dr.Xin Shi

Re: [R] metaplot (rmeta)

2010-07-20 Thread Michael Dewey
At 01:11 20/07/2010, Kate Snedeker wrote: Greetings I have been trying to use metaplot to create a forest plot of my meta-analysis results. My data is in the form of ORs, so I've been inputting the ORs as the point estimate (mn) and the SEs of the logORs as the SE (se). However, whilst the

[R] Help with time in R

2010-07-20 Thread Sarah Chisholm
Hi, I have a problem with the time formatting in R. I have entered time in the format MM:SS.xyz and R has automatically classified this as a factor, but I need it numerically. However when I use as.numeric() it gives me totally different numbers. Is there any way I can tell R to read thes

Re: [R] Help with time in R

2010-07-20 Thread jim holtman
# depends on what you want to do with it. # if you just want to convert to seconds, use the following x - c('12:23.45', '34:15.1', '1:34.23') # split by the : x.s - strsplit(x, :) # convert x.c - sapply(x.s, function(a){ + as.numeric(a[1]) * 60 + as.numeric(a[2]) + }) x.c [1] 743.45

[R] define subgroups based on position in table

2010-07-20 Thread STEVENS, Maarten
Dear list, I have a data frame with one column (group) and want to add a second column (sub) with a serial number that says to which subgroup a cell belongs. A subgroup contains the consecutive rows of the same group. The number of a subgroup is based on its position in the table. The first

Re: [R] trouble getting table of coeffs with quantreg with fixed effects

2010-07-20 Thread David Winsemius
On Jul 19, 2010, at 9:37 PM, Steve McDonald wrote: I'm a new user, so my apologies for what is likely a dumb question... I am having a hard time getting a table of regression results when using Koenker's code for quantile regression with fixed effects

Re: [R] Indexing by logical vectors

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 1:12 AM, Christian Raschke wrote: On Tue, 2010-07-20 at 10:12 +1000, bill.venab...@csiro.au wrote: As far as I know the answer to your question is No, but there are things you can do to improve the readability of your code. One thing I find useful is to avoid using $

[R] Exporting NMDS distance matris to csv

2010-07-20 Thread Graves, Gregory
If you submit these lines, you end up with variable vare.dis. I want to export vare.dis to csv. Stuck I am. library(vegan,logical.return = TRUE) #return=true verifies package is available library(MASS,logical.return=TRUE) #return=true verifies package is available data(varespec)

Re: [R] Help with time in R

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 7:33 AM, Sarah Chisholm wrote: Hi, I have a problem with the time formatting in R. I have entered time in the format MM:SS.xyz and R has automatically classified this as a factor, but I need it numerically. However when I use as.numeric() it gives me totally

[R] Fwd: setMethod( '[', c( 'data.frame', 'expression' ...

2010-07-20 Thread Christopher Brown
Hi, I am trying to write a method for [,data.frame,expression. But it give the error: * * *Error in xj[i] : invalid subscript type 'expression'* I looked at the help files and the archives. No avail. Any ideas? Here is an example that reproduces the error. setGeneric( '[' ) [1] [

Re: [R] Help with time in R

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 8:41 AM, David Winsemius wrote: On Jul 20, 2010, at 7:33 AM, Sarah Chisholm wrote: Hi, I have a problem with the time formatting in R. I have entered time in the format MM:SS.xyz and R has automatically classified this as a factor, but I need it numerically. However

[R] specify blank in a string with special characters

2010-07-20 Thread Mark Heckmann
is there a way to specify a blank in a string with special/escape characters? like: and now a blankand text after the blank, where stand for the specification of the blank character TIA Mark ––– Mark Heckmann Dipl. Wirt.-Ing. cand. Psych.

[R] Means from selected columns in a data frame

2010-07-20 Thread Marcus Drescher
Hi all, I have a dataframe with survey data. Now I want to calculate means from several but not all columns (e.g. a1, a2, a3) and save them in a new separate column (e.g. a). Like: a = mean(a1, a2, a3) Can someone help me or give me the right key word to look for? Thanks

Re: [R] define subgroups based on position in table

2010-07-20 Thread jim holtman
try this: x - read.table(textConnection(group + A + A + A + B + B + A + A + B + B + B + A + A),header=TRUE, as.is=TRUE) closeAllConnections() # use rle to get the 'runs' x.rle - rle(x$group) # now generate the group numbers x.grp - ave(x.rle$values, x.rle$values, FUN=seq_along) # put the

Re: [R] Reshaping data

2010-07-20 Thread Ista Zahn
On Tue, Jul 20, 2010 at 3:30 AM, John Kane jrkrid...@yahoo.ca wrote: Assuming your data is in data.frame xx library(reshape) mm1 - melt(xx, id=c(ID)) cast(mm1, ID  ~ variable )

Re: [R] Means from selected columns in a data frame

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:13 AM, Marcus Drescher wrote: Hi all, I have a dataframe with survey data. Now I want to calculate means from several but not all columns (e.g. a1, a2, a3) and save them in a new separate column (e.g. a). Well that would be possible unless you are in Minitab or

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 9:00 AM, Mark Heckmann wrote: is there a way to specify a blank in a string with special/escape characters? like: and now a blankand text after the blank, where stand for the specification of the blank character The answer to your question is yes, because you just

[R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread Jim Hargreaves
Dear List, After much searching with no success, I would like to ask how I can convert a unix/POSIX time (seconds since Jan 01, 1970) into a string like 01/01/1970 00:00 This is probably easily done with a system(date...) but it would be great if I could do it in R. Kind Regards, Jim

Re: [R] Means from selected columns in a data frame

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:25 AM, David Winsemius wrote: On Jul 20, 2010, at 9:13 AM, Marcus Drescher wrote: Hi all, I have a dataframe with survey data. Now I want to calculate means from several but not all columns (e.g. a1, a2, a3) and save them in a new separate column (e.g. a). Well

[R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Hello all, I am trying to write a program in R in which I call a function multiple times within a loop. The problem is that sometimes the function breaks down while calling another function, and produces an error message that breaks my loop and the program stops. I would like to keep the loop

Re: [R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:26 AM, Jim Hargreaves wrote: Dear List, After much searching with no success, I would like to ask how I can convert a unix/POSIX time (seconds since Jan 01, 1970) into a string like 01/01/1970 00:00 This is probably easily done with a system(date...) but it would

Re: [R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:44 AM, Patrick McKann wrote: Hello all, I am trying to write a program in R in which I call a function multiple times within a loop. The problem is that sometimes the function breaks down while calling another function, and produces an error message that breaks my

[R] nls with some coefficients fixed

2010-07-20 Thread nashjc
For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something I've been trying to get in such routines for over 2 decades. Masks are available, but not yet well documented, in Rcgmin and Rvmmin packages. However, these use an optim() style approach, which is

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Mark Heckmann
will reformulate the question: I use strsplit() to split a string at the blanks. e.g. strsplit(Split at blanks, ) [[1]] [1] Split at blanks Now I would like to write something like a protected blank (like e.g. in LaTex) into the string that does not get split by strsplit() but

Re: [R] Historical Libor Rates

2010-07-20 Thread Aaditya Nanduri
Mr. Feldman, I would love nothing more than to reply to your wonderful email with just as much sarcasm. However, the fault lies with my question; I should have been more explicit. It should have been phrased : Where can I find historical OVERNIGHT LIBOR rates? And surprisingly, we both use the

[R] p-values pvclust maximum distance measure

2010-07-20 Thread syrvn
Hi, I am new to clustering and was wondering why pvclust using maximum as distance measure nearly always results in p-values above 95%. I wrote an example programme which demonstrates this effect. I uploaded a PDF showing the results Here is the code which produces the PDF file:

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Wu Gong
Hi, you can define delimiters strsplit(Split%at blanks, |%) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/specify-blank-in-a-string-with-special-characters-tp2295453p2295639.html Sent from the R help mailing list archive at Nabble.com.

[R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-20 Thread Harlan Harris
Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet cells went away. I get the following weird error: Error in els[[type + 1]] : subscript out of bounds Looking at the Google Docs API changelog, I see

[R] p-values pvclust maximum distance measure

2010-07-20 Thread syrvn
Hi, I am new to clustering and was wondering why pvclust using maximum as distance measure nearly always results in p-values above 95%. I wrote an example programme which demonstrates this effect. I uploaded a PDF showing the results Here is the code which produces the PDF file:

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 10:09 AM, Mark Heckmann wrote: will reformulate the question: I use strsplit() to split a string at the blanks. e.g. strsplit(Split at blanks, ) [[1]] [1] Split at blanks Now I would like to write something like a protected blank (like e.g. in LaTex) into the string

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Mark Heckmann
This was just what I wanted, thanks!! Am 20.07.2010 um 16:43 schrieb Duncan Murdoch: On 20/07/2010 10:09 AM, Mark Heckmann wrote: will reformulate the question: I use strsplit() to split a string at the blanks. e.g. strsplit(Split at blanks, ) [[1]] [1] Split at blanks Now I

[R] Servreg $loglik

2010-07-20 Thread Charles Annis, P.E.
Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When I enter the data as 37 weighted observations, the parameter

Re: [R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Thank you so much! And in package 'base' no less...exactly what I needed! On Tue, Jul 20, 2010 at 8:55 AM, David Winsemius dwinsem...@comcast.netwrote: On Jul 20, 2010, at 9:44 AM, Patrick McKann wrote: Hello all, I am trying to write a program in R in which I call a function multiple

Re: [R] Exporting NMDS distance matris to csv

2010-07-20 Thread Gavin Simpson
On Tue, 2010-07-20 at 08:24 -0400, Graves, Gregory wrote: If you submit these lines, you end up with variable vare.dis. I want to export vare.dis to csv. Stuck I am. Hi Yoda ;-) library(vegan,logical.return = TRUE) #return=true verifies package is available

[R] Using fig= in one screen created with split.screen()

2010-07-20 Thread Birte Reichstein
Hi, I successfully created 3 screens with the following: fig.mat-c(0,.5,.5,.5,1,1,0,0,.5,1,.5,1) fig.mat-matrix(fig.mat,nrow=3) fig.mat split.screen(fig.mat) I can plot three different plots on those 3 screens, but when I try the following: (Trying to create three graphs with a common x-axis

[R] loop through files and create object

2010-07-20 Thread Daniel Caro
Hi R users, I am a newbie and therefore the naive question. Sorry but I was unable to find an answer online. I would like to read 47 data sets (country1.raw, country2.raw, ... country47.raw) and save into a matrix each time (data1, data2, data47). for (i in 1:47){ data(?) -

[R] plot() via java

2010-07-20 Thread nero
Hello, I need a possibility to print a function from R in Java with plot (). I have taken rJava package and have built up a connection (with the JRI). But if I call plot () in Java, a R_Graphics window (with R_Graphics:Device 2 (ACTIVE)) opens without contents. If I click this window, whole

[R] sem by variable x

2010-07-20 Thread Daniel Caro
Hi R users, I am new in R. I would like to perform confirmatory factor analysis for a data set of countries. My data are: data - read.csv(ses.raw, header = TRUE) attach(data) names(data) [1] idcntry momed daded dadocu momocu hompos finan The country id is idcntry, my model is

[R] Option pricing models

2010-07-20 Thread Suman Narayan
Hi, I am currently doing a project in which I wish to calculate the calculate the theoretical price of options using the following models: 1. Constant Elasticity of Variance (CEV) model 2. Merton's jump diffusion model 3. Variance Gamma model I am not sure as to how to implement this in R. I

[R] data from SpatialGridDataFrame

2010-07-20 Thread kfleis
Dear All, I have a raster map of the class 'SpatialPointsDataFrame' and coordinates of the class 'SpatialPoints'. I would like to retrieve the values that are contained in the raster map at the specific locations given by the coordinates. Can anyone help me out? Kind regards, Katrin Fleischer

[R] help me with holt-winter model

2010-07-20 Thread vijaysheegi
Hi R-experts, I have been wasted aroun 2 days to understand Holt-Winter method for double exponential smoothing.But concept was not clear to me.Please suggest me how to determeine values of alpha ,beta,gamma.It is bit urgent .please help me in understanding holtwinter parameter determination . I

Re: [R] loop through files and create object

2010-07-20 Thread Joshua Wiley
Hi Daniel, Try this: for(i in 1:47) { assign(x = paste(data, i, sep = ), value = read.csv(file.path(country, i, .raw, fsep = ), header = TRUE), envir = .GlobalEnv) } See ?assign for documentation. Cheers, Josh On Tue, Jul 20, 2010 at 4:52 AM, Daniel Caro dca...@googlemail.com wrote:

[R] Y axis break

2010-07-20 Thread Filoche
Hi there. I bet this question have been answered many times, but I cant find a good solution for my problem. I would like to put a axis break (on y axis) on that flowing plot (let's say between 20 and 80 in y). y = c(runif(10, 1, 10), 100); x = y + runif(11, 10, 50); plot(x,y) Is there any

[R] Random Forest - Strata

2010-07-20 Thread Coll
Hi all, Had struggled in getting Strata in randomForest to work on this. Can I get randomForest for each of its TREE, to get ALL sample from some strata to build tree, while leaving some strata TOTALLY untouched as oob? e.g. in below, how I can tell RF to, - for tree 1 in the forest, to use

Re: [R] Exporting NMDS distance matris to csv

2010-07-20 Thread Federico Andreis
On Tue, Jul 20, 2010 at 5:54 PM, Gavin Simpson gavin.simp...@ucl.ac.ukwrote: On Tue, 2010-07-20 at 08:24 -0400, Graves, Gregory wrote: If you submit these lines, you end up with variable vare.dis. I want to export vare.dis to csv. Stuck I am. Hi Yoda ;-) I want THIS on fortune() !

Re: [R] loop through files and create object

2010-07-20 Thread jim holtman
Consider using a 'list' to hold the matrices: dataList - lapply(1:47, function(num){ read.csv(paste('country', num, '.raw', sep=''), header=TRUE) } You can then access your data like: dataList[[23]] for the 23rd file read in. On Tue, Jul 20, 2010 at 7:52 AM, Daniel Caro

Re: [R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread jim holtman
Here is a function I use to convert a numeric value of the UNIX time to POSIXct unix2POSIXct - function (time) structure(time, class = c(POSIXt, POSIXct)) On Tue, Jul 20, 2010 at 9:26 AM, Jim Hargreaves ja...@ipec.co.uk wrote: Dear List, After much searching with no success, I would

Re: [R] Servreg $loglik

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 11:20 AM, Charles Annis, P.E. wrote: Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones.

Re: [R] nls with some coefficients fixed

2010-07-20 Thread Keith Jewell
nas...@uottawa.ca wrote in message news:33466.129.6.253.2.1279634282.squir...@webmail02.uottawa.ca... For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something I've been trying to get in such routines for over 2 decades. Masks are available, but not

[R] ifelse() and missing values in test conditions

2010-07-20 Thread Hosack, Michael
R experts, I have been unable to get the following ifelse statement to work as desired when applied to my data frame. Example: DF$ANYEF - with(DF,ifelse(PSOUGHT1=='ANY'|PSOUGHT2=='ANY'|PSOUGHT3=='ANY',PEFF,0)) # this statement will be replicated 16 times for 16 unique _EF variables

Re: [R] nls with some coefficients fixed

2010-07-20 Thread Gabor Grothendieck
On Tue, Jul 20, 2010 at 9:58 AM, nas...@uottawa.ca wrote: For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something I've been trying to get in such routines for over 2 decades. Masks are available, but not yet well documented, in Rcgmin and Rvmmin

Re: [R] Servreg $loglik

2010-07-20 Thread Charles Annis, P.E.
David: Thank you for your comments. I do understand that absolute values of likelihoods by themselves aren't meaningful, and only gain meaning when compared with others computed using the same model but with differing parameter values (for example). That is why I compute likelihoods myself for

Re: [R] Option pricing models

2010-07-20 Thread Arun.stat
Did you explore the fOptions package? Apart from lot of in-build functionalities you would see there lot of good references on options pricing. Thanks, -- View this message in context: http://r.789695.n4.nabble.com/Option-pricing-models-tp2295760p2295842.html Sent from the R help mailing list

[R] If help

2010-07-20 Thread Heiman, Thomas J.
Hi Y'all, I have some data in a table with 2 columns. There are two values: Reduction and No Reduction. I am trying to make a new variable change which recode the combinations from column 1 and 2 into a single number. Here is a snippet from the table: [1,] NoReduction

Re: [R] par(uin) ? / brace function

2010-07-20 Thread Michael Friendly
Thanks, Peter This more or less corresponds to the solution I came to, modulo xyinch() and atan2(x,y) = atan(x/y). It is mostly intended as a replacement for arrows() in statistical diagrams/plots where you want to show a given range in a plot precisely without additional boundary lines. It

[R] Registered / trademark signs

2010-07-20 Thread Dennis Fisher
Colleagues, What is the easiest means to embed a: ® (registered) or ™ (trademark) sign in text in a graphic. I would like to use mtext and avoid plotmath, if possible. Ideally, the sign should be superscripted but I can easily sacrifice that. Optimally, I need a solution that

Re: [R] sem by variable x

2010-07-20 Thread Jarrett Byrnes
You may want to take a look at the lavaan package and use the multigroup analysis there (and see if you even need to group by country as well). Otherwise, you could do something like library(sem) library(plyr) cfa_func-function(a.df){ cfa-sem(ses.model, cov(a.df[,2:7], nrow(a.df)))

Re: [R] If help

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 1:14 PM, Heiman, Thomas J. wrote: Hi Y'all, I have some data in a table with 2 columns. There are two values: Reduction and No Reduction. I am trying to make a new variable change which recode the combinations from column 1 and 2 into a single number. Here is a

Re: [R] Problem with command apply

2010-07-20 Thread Berend Hasselman
litao.ext wrote: I try to utilize some operations on rows in a matrix using command 'apply' but find a problem. First I write a simple function to normalize a vector (ignore error handling) as follows: normalize = function( v ) { return( ( v-min(v) ) / ( max(v) - min(v) ) ) }

Re: [R] Registered / trademark signs

2010-07-20 Thread Henrique Dallazuanna
I don't know if this works in OSX, but in XP: plot(0) title('\u00ae - \u2122') On Tue, Jul 20, 2010 at 2:22 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, What is the easiest means to embed a: ® (registered) or ™ (trademark) sign in text in a graphic. I

Re: [R] If help

2010-07-20 Thread jim holtman
Try this, assuming your data is consistent: x - read.table(textConnection('NoReduction NoReduction + ReductionReduction + NoReduction NoReduction + NoReduction NoReduction + ReductionReduction + Reduction

Re: [R] ifelse() and missing values in test conditions

2010-07-20 Thread Joshua Wiley
Hi Mike, Probably the simplest way from what you have done would be to just set any NA values in the column to 0: DF$ANYEF[is.na(DF$ANYEF)] - 0 Alternately, you can try this. It should work, but it is far from elegant. DF$ANYEF - with(DF, ifelse( rowSums(cbind(PSOUGHT1, PSOUGHT2, PSOUGHT3)

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread StatWM
Thank you very much for your effort! But is there a measure, which can compare the goodness of fit of regression models with and without the intercept? Can I only compare them in terms of sum of squares residual? -- View this message in context:

Re: [R] Registered / trademark signs

2010-07-20 Thread David Winsemius
Works on OSX 10.5.8 + R2.11.1 -- David. On Jul 20, 2010, at 1:36 PM, Henrique Dallazuanna wrote: I don't know if this works in OSX, but in XP: plot(0) title('\u00ae - \u2122') On Tue, Jul 20, 2010 at 2:22 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, What is the easiest

[R] square brackets in expression in plots

2010-07-20 Thread Jannis
Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): speed [m s^-1] I know how to combine an expression with text via paste, but as I

Re: [R] square brackets in expression in plots

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 12:42 PM, Jannis wrote: Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): speed [m s^-1] Not exactly

Re: [R] square brackets in expression in plots

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 12:42 PM, Jannis wrote: Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): speed [m s^-1] I know how to combine an

[R] simplify if statement in R ?

2010-07-20 Thread Jim Maas
I found a form of the if statement that works but it is very long. I'm attempting to check the value of of two different variables to see if they evaluate to either of two different values, which will result in a division by 0 in the final equation. This first if statement works for me

Re: [R] Y axis break

2010-07-20 Thread Wu Gong
plotrix can do it. There is a post about axis break. http://r.789695.n4.nabble.com/template/NodeServlet.jtp?tpl=replynode=2295499 - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-break-tp2295499p2295998.html Sent from the R help mailing list archive at

Re: [R] Indexing by logical vectors

2010-07-20 Thread Kingsford Jones
On Mon, Jul 19, 2010 at 11:12 PM, Christian Raschke cras...@tigers.lsu.edu wrote: snip but in the end I have other cases, where the logical vector is obtained from other operations or where the value that is assigned is different case by case; for example,

[R] Problem with command apply

2010-07-20 Thread litao.ext
I try to utilize some operations on rows in a matrix using command 'apply' but find a problem. First I write a simple function to normalize a vector (ignore error handling) as follows: normalize = function( v ) { return( ( v-min(v) ) / ( max(v) - min(v) ) ) } The function works fine for

[R] library ts

2010-07-20 Thread Tra, Yolande
Hi, I could not locate library ts in the CRAN website. Please help. Yolande [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] How can I get the principal components after a varimax rotation using Varimax function?

2010-07-20 Thread Francisco Javier Santos Alamillos
Dear R users, I have some question about Varimax rotation of the loadings obtained from a PCA. Imagine X is a field where the rows are the observations and the columns are the variables. I obtain the loadings (L), the principal components (PC) and the percentage of the variance for each mode

[R] Limited output

2010-07-20 Thread confusedcius
Hi there, I entered over 2000 lines of data into R from SQLite and saved it in R as a data.frame, but the data.frame only gives the first 500 lines. Is there any way to either increase the default limit or to determine which of the original lines should be in the output (e.g. maybe the last 500

  1   2   >