Re: [R] Importing CSV File

2010-10-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.10.2010 00:47:22: sales - read.csv(file=C:/Program Files/R/Test Data/sales.csv, header=TRUE, row.names = Month) ^^^ -Original Message- From: r-help-boun...@r-project.org

[R] Random Integer Number in Uniform Distribution

2010-10-25 Thread Gundala Viswanath
Is there a way to do it? At best what I can achieve is non integer: runif(10, min=1, max=100) [1] 51.959151 56.654146 63.630251 3.172794 4.073018 11.977437 86.601869 [8] 75.788618 11.734361 6.770962 -G.V. __ R-help@r-project.org mailing list

Re: [R] Random Integer Number in Uniform Distribution

2010-10-25 Thread Nick Sabbe
Check ?sample. Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gundala

[R] structural equation modeling in sem, error, The model has negative degrees of freedom = -3, and The model is almost surely misspecified...

2010-10-25 Thread Alex Anderson
Hi all, I am attempting to learn my way through the sem package by constructing a simple structural model for some of my data on bird diversity, abundance, and primary productivity. I have constructed a covariance matrix between these variables as per the following: S_matrix = matrix(c( +

[R] if statement and truncated distribution

2010-10-25 Thread Sally Luo
Hi R helpers, I am trying to use the if statement to generate a truncated random variable as follows: if (y[i]==0) { v[i] ~ rnorm(1,0,1) | (-inf ,0) } if (y[i]==1) { v[i] ~ rnorm(1,0,1) | (0, inf) } I guess I cannot use | ( , ) to restrict the range of a variable in R. Could you let me know

Re: [R] if statement and truncated distribution

2010-10-25 Thread Nick Sabbe
What I guess you want is something like (this is for zero-truncation): rZeroTruncNormal1d-function(mu, sig, invalidSign) #sig holds standard deviation! { val-rnorm(1, mu, sig) while(val * invalidSign 0) { val-rnorm(1, mu, sig) } return(val)

[R] .R file

2010-10-25 Thread zhiji19
Hello everyone Can you please teach me how to save my homework as .R file? I write my code in RGui. When I tried to save my work, the RGui only allows me to save it as .RData. By the way, after I save my work as .RData, I cannot reopen it. when I open it, only one message comes out as

[R] Using tapply?

2010-10-25 Thread Amy Milano
Dear R helpers, I am trying to calculate the Annualized Percent Rate using following R - Code. # ## R Code library(animation) # INPUT C = 25    # Loan Amount E = 2500  # Other Cost R = 6 # Interest rate r =

[R] problem with make distribution

2010-10-25 Thread Erin Hodgess
Dear R People: I'm trying to experiment with the make distribution with R-2.12.0 when compiling from source on Windows. It works fine on Windows XP, but I'm having a snag with Windows 7. Here is the snag: cp -prf ../../../Tcl R-2.12.0 cp: preserving permissions for `R-2.12.0/Tcl/bin': Invalid

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread Jim Lemon
On 10/25/2010 03:30 AM, Lorenzo Isella wrote: Hello, I feel I am drowning in a glass of water. Consider the following snippet at the end of the email, where I generated a set of {x,y,s=f(x,y)} values, i.e. a set of 2D coordinates + a scalar on a circle. Now, I can get a scatterplot in 3D, but

Re: [R] .R file

2010-10-25 Thread Tal Galili
There is most of what you need here: http://www.statmethods.net/interface/workspace.html Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il

[R] font.lab and font.axis

2010-10-25 Thread Jim Lemon
Hi all, In the course of ongoing improvement of plotrix, I was alerted to the fact that setting, e.g.: par(font.lab=3, font.axis=3) only seems to work for plot (and maybe other functions), but not for axis. par(font=3) works for everything (except the title, which is probably specified

[R] Error: could not find function lmList

2010-10-25 Thread Rosario Garcia Gil
Dear colleges, I would like to use the lmList function. I have installed the lme4 library but when I try to use the lmList function I get this error message. Error: could not find function lmList Here you can see what kind of messages I am getting when installing lme4 package. Does anyone

Re: [R] Error: could not find function lmList

2010-10-25 Thread Ivan Calandra
Hi, You need to update your packages (and maybe upgrade R at the same time). See the FAQ for Windows 2.8 to know how to do it correctly. Ivan Le 10/25/2010 10:14, Rosario Garcia Gil a écrit : Dear colleges, I would like to use the lmList function. I have installed the lme4 library but when I

Re: [R] Controlling number of numbers before R rewrites to +e18 etc

2010-10-25 Thread ZeMajik
Thanks Jim, but I still got the problem that the pre-processing becomes way too computationally expensive. R seems to handle characters and factors much much worse than numeric IDs. I don't have enough RAM to even write the file when they are viewed as chars instead of numeric values! Anyone have

Re: [R] re-vertical conversion of data entries

2010-10-25 Thread Uwe Ligges
It is just that the vertical (column) vector is represented that way in R. If you want to dsiplay it in a column, just generate a matrix, for simplicity: matrix(x, ncol=1) Uwe Ligges On 25.10.2010 05:45, Penny Adversario wrote: Dear R user, Can you please help me. How do I convert

Re: [R] font.lab and font.axis

2010-10-25 Thread Łukasz Ręcławowicz
2010/10/25 Jim Lemon j...@bitwrit.com.au Would someone like to suggest a better way to get axis to look at the font it's supposed to be using? Are you looking for something like this? x-rnorm(100) hist(x,axes=F,font.lab=12,font.main=9) axis(1,font.axis=4) axis(2,font.axis=3) -- Mi³ego dnia

Re: [R] RODBC: data base with decimal point ,

2010-10-25 Thread RINNER Heinrich
Hello Marc, thanks very much for your answer! I had tried setting options(dec) before doing anything else, but that didn't solve the problem. Reading section Internationalization Issues didn't make me much wiser, so I'll search the archives of the e-mail list you mentioned, maybe I find

Re: [R] Unable to allocate arrays of size 2GB in 64 bit Windows 7 R

2010-10-25 Thread Uwe Ligges
Do you use a 64-bit version of R? I suspect you are using a 32-bit build. The R-2.12.0 installer comes with binaries for both architectures. Uwe Ligges On 25.10.2010 04:25, Bhattacharyya, Siddhartha wrote: I seem Unable to allocate arrays of size around 2GB in 64 bit Windows 7 R. There is a

[R] plot does not work

2010-10-25 Thread Alaios
Hello everyone The following two commands plot.default(seq(1,5),seq(2,6)) plot(seq(1,5),seq(2,6)) plot nothing. One day ago this would create a simple plot diagram but unfortunately right now no plot appears. ?plot returns Help on topic 'plot' was found in the following packages: Plot a

Re: [R] plot does not work

2010-10-25 Thread Uwe Ligges
You are probably plotting into a pdf device (the default if no X11 available). Uwe Ligges On 25.10.2010 11:44, Alaios wrote: Hello everyone The following two commands plot.default(seq(1,5),seq(2,6)) plot(seq(1,5),seq(2,6)) plot nothing. One day ago this would create a simple plot diagram

Re: [R] problem with make distribution

2010-10-25 Thread Prof Brian Ripley
On Mon, 25 Oct 2010, Erin Hodgess wrote: Dear R People: I'm trying to experiment with the make distribution with R-2.12.0 when compiling from source on Windows. It works fine on Windows XP, but I'm having a snag with Windows 7. Here is the snag: cp -prf ../../../Tcl R-2.12.0 cp: preserving

Re: [R] Interpolate irregular time series

2010-10-25 Thread Gavin Simpson
On Fri, 2010-10-22 at 12:50 +, Salim Alexander (salimale) wrote: Hi all, Issue: I have two datasets, one is a regular time series (rain gauge) with resolution of 10 minutes. The other one is an irregular time series (link). Now I want to analyze the correlation between these two

[R] How to save R file into specific type

2010-10-25 Thread zhiji19
Hello everyone Can you please teach me how to save my homework as .R file? I write my code in RGui. When I tried to save my work, the RGui only allows me to save it as .RData. Is there any difference between .R and .RData? By the way, after I save my work as .RData, I cannot reopen it. when

Re: [R] gam plots and seWithMean

2010-10-25 Thread Greg Dropkin
hadn't realised the answer would be in the source code! anyway, this appears to work. The only difference is in the last section. greg -- library(mgcv) #simulate some data x1-runif(500) x2-rnorm(500) x3-rpois(500,3) d-runif(500) t-runif(500,20,50) linp--6.5+x1+2*x2-x3+2*exp(-2*d)*sin(2*pi*d)

Re: [R] plot does not work

2010-10-25 Thread Alaios
What is a pdf device? How to change this? From: Uwe Ligges lig...@statistik.tu-dortmund.de Cc: Rhelp r-help@r-project.org Sent: Mon, October 25, 2010 11:49:37 AM Subject: Re: [R] plot does not work You are probably plotting into a pdf device (the default if

Re: [R] plot does not work

2010-10-25 Thread Uwe Ligges
See ?x11 ?pdf Uwe Ligges On 25.10.2010 12:16, Alaios wrote: What is a pdf device? How to change this? *From:* Uwe Ligges lig...@statistik.tu-dortmund.de *To:* Alaios ala...@yahoo.com *Cc:* Rhelp r-help@r-project.org

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread Lorenzo Isella
On 10/25/2010 01:32 AM, David Winsemius wrote: You were advised to look at rms. Why have you dismissed this suggestion? Using your data setup below and packaging into a dataframe. require(rms) ddf - datadist(xysf - as.data.frame(xys)) olsfit - ols(V3~rcs(V1,3)+rcs(V2,3), data=xysf) bounds -

Re: [R] Unable to allocate arrays of size 2GB in 64 bit Windows 7 R

2010-10-25 Thread Duncan Murdoch
Bhattacharyya, Siddhartha wrote: I seem Unable to allocate arrays of size around 2GB in 64 bit Windows 7 R. There is a lot of main memory available. The memory.limit is set to the max memory available, and there is more than 10GB of that available when R returns an 'unable to allocate memory'

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Berwin A Turlach
G'day Remko, On Mon, 25 Oct 2010 15:33:30 +1100 Remko Duursma remkoduur...@gmail.com wrote: apologies if this is somewhere in a manual, I have not been able to find anything relevant. You probably have to set some appropriate flags and the information should be somewhere in the manual of

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Duncan Murdoch
Remko Duursma wrote: Dear R-helpers, apologies if this is somewhere in a manual, I have not been able to find anything relevant. I run Windows Vista. I have some Fortran code in a subroutine, and have no problem calling this from R with .Fortran, compiling the code either with 'R CMD SHLIB'

Re: [R] Using tapply?

2010-10-25 Thread Dennis Murphy
Hi: I'm pretty sure that newton.method in the animation package is meant to illustrate the technique rather than to be used as an optimizer in practice. Look at ?optim; it that doesn't meet your needs, consult the Optimization Task View at CRAN, where you will find several packages, in addition

[R] difftime error

2010-10-25 Thread dpender
R community, I am trying to create an array of the time differences between datapoints for a very large set. For some reason for 4 of the values the difference has been calculated as NA. Looking at the individual points two of them are 1981-03-29 01:40:00 and 1981-03-29 02:00:00 This is the

Re: [R] difftime error

2010-10-25 Thread Uwe Ligges
On 25.10.2010 12:55, dpender wrote: R community, I am trying to create an array of the time differences between datapoints for a very large set. For some reason for 4 of the values the difference has been calculated as NA. Looking at the individual points two of them are 1981-03-29

Re: [R] How to save R file into specific type

2010-10-25 Thread Sarah Goslee
You should probably ask your professor to be certain, but I would suggest writing your code in a text editor and saving it with the .R extension. Saving a .RData file using save() [you didn't tell us what you did] saves the objects but not the code used to generate them. An .RData file can be

[R] penalized regression analysis

2010-10-25 Thread Andrew Halford
Hi All, I am using the package 'penalized' to perform a multiple regression on a dataset of 33 samples and 9 explanatory variables. The analysis appears to have performed as outlined and I have ended up with 4 explanatory variables and their respective regression coefficients. What I am

Re: [R] difftime error

2010-10-25 Thread Prof Brian Ripley
On Mon, 25 Oct 2010, dpender wrote: R community, I am trying to create an array of the time differences between datapoints for a very large set. For some reason for 4 of the values the difference has been calculated as NA. Looking at the individual points two of them are 1981-03-29 01:40:00

Re: [R] .R file

2010-10-25 Thread Dennis Murphy
Hi : It's not clear whether you want to save your code, your R object or both. Tal has already directed you to help for saving objects created in your workspace. As for saving the code, many people write their code in an editor and either copy/paste it into the workspace or, with certain editors,

Re: [R] Using tapply?

2010-10-25 Thread Amy Milano
Dear Sir, Thanks a lot for your advice and surely I will be going through your suggestion as regards  ?optim. In the mean time, is it possible to guide me regarding one general question. Suppose instead of using newton.method function, I am using some other function resulting in some other

[R] Find index of a string inside a string?

2010-10-25 Thread yoav baranan
Hi, I am searching for the equivalent of the function Index from SAS. In SAS: index(abcd, bcd) will return 2 because bcd is located in the 2nd cell of the abcd string. The equivalent in R should do this: myIndex - foo(abcd, bcd) #return 2. What is the function that I am looking for? I

Re: [R] Find index of a string inside a string?

2010-10-25 Thread Nick Sabbe
For simple searches, use grep with fixed=TRUE. Check ?grep. Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original Message- From: r-help-boun...@r-project.org

Re: [R] Find index of a string inside a string?

2010-10-25 Thread yoav baranan
Thank you. I know grep, but I don't know how to use it for what I need to do. for instance: grep(bcd, abcd) returns: [1] 1 grep(bcd, aabcd) returns: [1] 1 I need the first one to return 2 (b is in the 2nd cell), and the second one return 3 (b is in the 3rd cell). thanks From:

Re: [R] difftime error

2010-10-25 Thread dpender
That's it exactly. Do you know how to specify the timezone for Sydney, Australia? -- View this message in context: http://r.789695.n4.nabble.com/difftime-error-tp3010105p3010175.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Find index of a string inside a string?

2010-10-25 Thread jim holtman
I think what you want is 'regexpr': regexpr(bcd, aabcd) [1] 3 attr(,match.length) [1] 3 On Mon, Oct 25, 2010 at 7:27 AM, yoav baranan ybara...@hotmail.com wrote: Hi, I am searching for the equivalent of the function Index from SAS. In SAS: index(abcd, bcd) will return 2 because bcd is

Re: [R] Find index of a string inside a string?

2010-10-25 Thread Hadley Wickham
Or str_locate: library(stringr) str_locate(aabcd, bcd) Hadley On Mon, Oct 25, 2010 at 5:53 AM, jim holtman jholt...@gmail.com wrote: I think what you want is 'regexpr': regexpr(bcd, aabcd) [1] 3 attr(,match.length) [1] 3 On Mon, Oct 25, 2010 at 7:27 AM, yoav baranan

Re: [R] plot does not work

2010-10-25 Thread jim holtman
try 'graphics.off()' to close any device that might be open and see if you see any output. On Mon, Oct 25, 2010 at 5:44 AM, Alaios ala...@yahoo.com wrote: Hello everyone The following two commands plot.default(seq(1,5),seq(2,6)) plot(seq(1,5),seq(2,6)) plot nothing. One day ago this would

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Berwin A Turlach
G'day all, On Mon, 25 Oct 2010 06:52:15 -0400 Duncan Murdoch murdoch.dun...@gmail.com wrote: Remko Duursma wrote: [...] I.e, my code looks something like this: subroutine f(x,y,z) call g(x,y,z) end subroutine g(x,y,z) z = x*y end calling this from R shows

Re: [R] Controlling number of numbers before R rewrites to +e18 etc

2010-10-25 Thread jim holtman
You can always read a portion of the file and then write it out. For large files, I will read in 10,000 line, fix them up and then write them out and go back and process the next batch of lines. You haven't shown us what a sample of your input/output is, or how you are processing them.

Re: [R] .R file

2010-10-25 Thread Mike Marchywka
All three of these editors are external to R but have the capability of sending code from the editor to the console. All of them are good and have loyal user bases. Notepad++ is another option; but you have to copy/paste code to R - I mention it because it has syntax highlighting and is

Re: [R] Find index of a string inside a string?

2010-10-25 Thread yoav baranan
Indeed, thank you. The exact equivalent of index in SAS seems to me: regexpr(bcd, aabcd, fixed=T)[1] [1] 3 Date: Mon, 25 Oct 2010 07:53:22 -0400 Subject: Re: [R] Find index of a string inside a string? From: jholt...@gmail.com To: ybara...@hotmail.com CC: r-help@r-project.org I think

Re: [R] font.lab and font.axis

2010-10-25 Thread Łukasz Ręcławowicz
W dniu 25 pa¼dziernika 2010 13:14 u¿ytkownik Jim Lemon j...@bitwrit.com.aunapisa³: On 10/25/2010 08:02 PM, £ukasz Rêc³awowicz wrote: 2010/10/25 Jim Lemon j...@bitwrit.com.au mailto:j...@bitwrit.com.au Would someone like to suggest a better way to get axis to look at the font it's

[R] zoo.read intraday data

2010-10-25 Thread Immanuel
Hello all, I'm trying to use zoo.read but can't figure out how to deal with the time format. (example below) would be nice if someone could help. best regards, Immanuel --- L - Date,Time,Open,High,Low,Close,Up,Down

Re: [R] .R file

2010-10-25 Thread Jakson A. Aquino
On Mon, Oct 25, 2010 at 9:11 AM, Mike Marchywka marchy...@hotmail.com wrote: You mention Notepad++, I'm still using vi under cygwin and an ancient copy of ultra edit. People who uses vi or vim may be interested in looking at the plugin to Vim that I'm developing. The plugin works in Windows,

Re: [R] zoo.read intraday data

2010-10-25 Thread Achim Zeileis
On Mon, 25 Oct 2010, Immanuel wrote: Hello all, I'm trying to use zoo.read Just for the record: read.zoo(). but can't figure out how to deal with the time format. (example below) Yes, the problem is only the chron conversion (and not read.zoo). would be nice if someone could help.

Re: [R] zoo.read intraday data

2010-10-25 Thread Immanuel
Hey, work's like a charm. thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] zoo.read intraday data

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 9:02 AM, Immanuel mane.d...@googlemail.com wrote: Hello all, I'm trying to use zoo.read but can't figure out how to deal with the time format. (example below) would be nice if someone could help. best regards, Immanuel --- L -

Re: [R] best predictive model for mixed catagorical/continuous variables

2010-10-25 Thread Robert Baer
I would expect that there will be interactions between variables eg. if the vegetation is grassland then the vegetation height variable will mediate the interaction, if the vegetation is arable then crop type will be more significant. Would it be possible to use GLM or GAM models for this type

Re: [R] Optimize parameters of ODE Problem which is solved numeric

2010-10-25 Thread Ravi Varadhan
Hi Michael, You do not need a numerical solver for this. This is a linear system of ODEs and it admits closed form solutions. The solution is given as: Y(t) = c_1 * v_1 * exp(k_1 * t) + ... + c_4 * v_4 * exp(k_4 * t) where k_1, ..., k_4 are the eigenvalues (can be real or complex) and v_1,

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread David Winsemius
On Oct 25, 2010, at 3:41 AM, Lorenzo Isella wrote: On 10/25/2010 01:32 AM, David Winsemius wrote: You were advised to look at rms. Why have you dismissed this suggestion? Using your data setup below and packaging into a dataframe. require(rms) ddf - datadist(xysf - as.data.frame(xys))

Re: [R] How to save R file into specific type

2010-10-25 Thread David Winsemius
On Oct 25, 2010, at 1:07 AM, zhiji19 wrote: Hello everyone Can you please teach me how to save my homework as .R file? ?savehistory # at least on a Mac (If you wanted the whole console session with output, then it would be select-all, copy, paste into a text editor, save as a text

[R] Q reg connecting to existing dll

2010-10-25 Thread Gandhi, Puneet - RSCH AMRS
Hi, I am an R newbie and trying to migrate from VB to R. I downloaded data from Haver using an existing dll in VB. For e.g. I declared functions such as Private Declare Function DLXOpenDatabase Lib DLXAPI32 (ByVal DBName$) As Long And then used them as k = DLXOpenDatabase(W:/DLX/USECON)

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Berend Hasselman
Berwin A Turlach wrote: Remko Duursma wrote: [...] I.e, my code looks something like this: subroutine f(x,y,z) call g(x,y,z) end subroutine g(x,y,z) z = x*y end calling this from R shows that subroutine g is not called. The code compiled as

[R] lowess() won't handle NAs

2010-10-25 Thread Federico Bonofiglio
Dear Masters, I'm driving crazy with the lowess() function my intent is smoothing confidence intervals for predicted y values in a linear model lm() setting since in the predict() function there exists an option for predicting NA values, I instead encounter problems when I fit a missing

[R] help on lme extraction

2010-10-25 Thread Jin, Jp
Dear R list, I need some help in extracting comparisons in the result of lme. I have a data set similar to the example data, Orthodont, using patient subject as a random effect and did something below: library(nlme) library(gregmisc) data(Orthodont) Orthodont$AgeGroup -

[R] Using R with Google Storage/Big Query and Prediction API

2010-10-25 Thread Ajay Ohri
Dear List Google has new beta lists for storage, querying and prediction at http://code.google.com/apis/predict/docs/getting-started.html http://code.google.com/apis/predict/docs/getting-started.html http://code.google.com/apis/bigquery/docs/getting-started.html#intro

[R] non-stationary ar part in css

2010-10-25 Thread Benedikt Gehr
Hi I would like to use arima () to find the best arima model for y time series. The default in arima apparently is to use conditional sum of squares to find the starting values and then ML (as described on the help page). Now using the default may lead to error messages saying: non-stationary

Re: [R] structural equation modeling in sem, error, The model has negative degrees of freedom = -3, and The model is almost surely misspecified...

2010-10-25 Thread John Fox
Dear Alex, Your problem doesn't have much to do with the sem package. The model that you're trying to estimate is grossly underidentified. The model has 9 parameters to estimate and there are only 3*4/2 = 6 covariances among the 3 observed variables, hence the -3 df. There are also no exogenous

Re: [R] lowess() won't handle NAs

2010-10-25 Thread Jonathan P Daily
Try using the loess() function instead - it has an na.action parameter that should be able to handle your problem. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

[R] Mixed-effects model for overdispersed count data?

2010-10-25 Thread Marie-Hélène Hachey
Hi, I have to analyse the number of provisioning trips to nestlings according to a number of biological and environmental factors. I was thinking of building a mixed-effects model with species and nestid as random effects, using a Poisson distribution, but the data are overdispersed

Re: [R] 140 packages in R Commander!!

2010-10-25 Thread Ajay Ohri
Hi John Its not the download I mind - it's a one shot thing- Could you think of integrating the help across plugins- that can help. For example I really want to know which plugin would use snow and foreach if at all Ajay Websites- http://decisionstats.com http://dudeofdata.com Linkedin-

Re: [R] 140 packages in R Commander!!

2010-10-25 Thread John Fox
Dear Ajay, Each of the Rcmdr plug-ins is an R package with its own dependencies, which you can check on CRAN. Since dependencies can have dependencies, etc., you'd have to be careful in drawing conclusions. I'm not sure what the help system has to do with it. Best, John

[R] extracting characteristics of datasets from data()

2010-10-25 Thread Michael Friendly
I can use data() to find the available datasets in a package, but I'd like to extract and display some additional information for each dataset than what is provided by data(), e.g., class() and dim() for datasets for which these are available. I'm stuck on using using lapply properly with

Re: [R] zoo.read intraday data

2010-10-25 Thread Immanuel
Thanks, by now I ran already into the next problem, while trying to convert the zoo to an xts object. Somehow the timestamps get lost, no idea why. I did read through the vignettes, but got confused by all this, chron, as.POSIXct, zoo and xts stuff. with your example I got: Error in .subset(x,

Re: [R] Mixed-effects model for overdispersed count data?

2010-10-25 Thread Ben Bolker
Marie-Hélène Hachey marie_helene48 at hotmail.com writes: Hi, I have to analyse the number of provisioning trips to nestlings according to a number of biological and environmental factors. I was thinking of building a mixed-effects model with species and nestid as random effects,

Re: [R] zoo.read intraday data

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 11:44 AM, Immanuel mane.d...@googlemail.com wrote: Thanks, by now I ran already into the next problem, while trying to convert the zoo to an xts object. Somehow the timestamps get lost, no idea why. I did read through the vignettes, but got confused by all this,

[R] building lme call via call()

2010-10-25 Thread Vito Muggeo (UniPa)
dear all, I would like to get the lme call without fitting the relevant model. library(nlme) data(Orthodont) fm1 - lme(distance ~ age, random=list(Subject=~age),data = Orthodont) To get fm1$call without fitting the model I use call(): my.cc-call(lme.formula, fixed= distance ~ age, random =

Re: [R] extracting characteristics of datasets from data()

2010-10-25 Thread Seeliger . Curt
Michael writes: I can use data() to find the available datasets in a package, but I'd like to extract and display some additional information for each dataset than what is provided by data(), e.g., class() and dim() for datasets for which these are available. ... for all datasets in

[R] finding the year of a date

2010-10-25 Thread Dimitri Liakhovitski
I know that I can use as.yearmon in the package zoo to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one find just the year of a date? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com

Re: [R] finding the year of a date

2010-10-25 Thread Henrique Dallazuanna
Try this: format(Sys.Date(), %Y) On Mon, Oct 25, 2010 at 2:38 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I know that I can use as.yearmon in the package zoo to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one

Re: [R] finding the year of a date

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 12:38 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I know that I can use as.yearmon in the package zoo to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one find just the year of a date?

Re: [R] Question on passing the subset argument to an lm wrapper

2010-10-25 Thread Charles C. Berry
On Sun, 24 Oct 2010, Erik Iverson wrote: Hello, How would you go about handling the following situation? This is on R 2.12.0 on Ubuntu 32-bit. I have a wrapper function to lm. I want to pass in a subset argument. First, I just thought I'd use The subset arg needs to be unevaluated

Re: [R] Question on passing the subset argument to an lm wrapper

2010-10-25 Thread Henrique Dallazuanna
As workaround you can try this: testlm - function(formula, ...) { args - list(formula, data = df1, ...) do.call(lm, args) } testlm(bmi ~ age, subset = df1$age 50) On Mon, Oct 25, 2010 at 2:16 AM, Erik Iverson er...@ccbr.umn.edu wrote: Hello, How would you go about handling the

[R] dataframe, transform, strsplit

2010-10-25 Thread Matthew Pettis
Hi, I have a dataframe that has a column of vectors that I need to extract off the character string before the first '.' character and put it into a separate column. I thought I could use 'strsplit' for it within 'transform', but I can't seem to get the right invocation. Here is a sample

[R] Hausman Test

2010-10-25 Thread Amrita Ghosh Dastidar
Hi, I'm trying to conduct a Hausman test to choose between FE estimators and RE estimators. When I run the code, I get an error: Error in solve.default(dvcov) : system is computationally singular: reciprocal condition number = 3.7981e-22 Can someone please help me with this problem? ~ Amrita

Re: [R] dataframe, transform, strsplit

2010-10-25 Thread jim holtman
try this: df have want 1 a.b.ca 2 d.e.fd 3 g.h.ig df$get - gsub(^([^.]+).*, \\1, df$have) df have want get 1 a.b.ca a 2 d.e.fd d 3 g.h.ig g On Mon, Oct 25, 2010 at 12:53 PM, Matthew Pettis matthew.pet...@gmail.com wrote: Hi, I have a dataframe that has

Re: [R] dataframe, transform, strsplit

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 12:53 PM, Matthew Pettis matthew.pet...@gmail.com wrote: Hi, I have a dataframe that has a column of vectors that I need to extract off the character string before the first '.' character and put it into a separate column.  I thought I could use 'strsplit' for it

Re: [R] dataframe, transform, strsplit

2010-10-25 Thread Matthew Pettis
Thanks Gabor and Jim, Both solutions worked equally well for me (now I have an embarrassment of riches for a solution :-) ). Now that my main problem is solved, I am happy, but I was wondering if anyone would care to comment as to why my 'strsplit' solution doesn't behave the way I think it

[R] CRAN vs R-Forge

2010-10-25 Thread Jason Kwok
What's the difference between the packages you get from CRAN and R-Forge? Are the packages you get from CRAN fully developed and R-Forge work-in-progress? Regards, Jason [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] dataframe, transform, strsplit

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 1:20 PM, Matthew Pettis matthew.pet...@gmail.com wrote: Thanks Gabor and Jim, Both solutions worked equally well for me (now I have an embarrassment of riches for a solution :-) ). Now that my main problem is solved, I am happy, but I was wondering if anyone would care

Re: [R] extracting characteristics of datasets from data()

2010-10-25 Thread Henrique Dallazuanna
Try this: data(list = DS$results[,'Item'], package = 'vcdExtra', envir = ne - new.env()) cbind(do.call(rbind, eapply(ne, function(x)data.frame(class = class(x), dim = paste(dim(x), collapse = 'x', Title = DS$results[,'Title']) On Mon, Oct 25, 2010 at 1:45 PM, Michael Friendly

Re: [R] CRAN vs R-Forge

2010-10-25 Thread Steve Lianoglou
Hi, On Mon, Oct 25, 2010 at 1:29 PM, Jason Kwok jayk...@gmail.com wrote: What's the difference between the packages you get from CRAN and R-Forge? Are the packages you get from CRAN fully developed and R-Forge work-in-progress? You pretty much got it right. R-forge provides an ecosystem to

Re: [R] finding the year of a date

2010-10-25 Thread Dimitri Liakhovitski
Thank you very much! Dimitri On Mon, Oct 25, 2010 at 12:46 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Oct 25, 2010 at 12:38 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I know that I can use as.yearmon in the package zoo to find the year and the month of a

Re: [R] building lme call via call()

2010-10-25 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Vito Muggeo (UniPa) Sent: Monday, October 25, 2010 9:16 AM To: r-h...@stat.math.ethz.ch Subject: [R] building lme call

Re: [R] Mixed-effects model for overdispersed count data?

2010-10-25 Thread dave fournier
According to the documentation for glmmADMB if you fit your model with a statment like fit =glmm.admb(y~Base*trt+Age+Visit, ... data=epil2,family=nbinom) and that the parameter estimates are in fit$b while their estimated standard deviations are in fit$stdbeta so presumably p

Re: [R] Conditional looping over a set of variables in R

2010-10-25 Thread David Herzberg
Adrienne, there's one glitch when I implement your solution below. When the loop encounters a case with no data at all (that is, all 140 item responses are missing), it aborts and prints this error message: ERROR: argument is of length zero. I wonder if there's a logical condition I could

Re: [R] Chron object in time series plot

2010-10-25 Thread Manta
I would like to thank you all for the help given so far! I have the following object of the class 'zoo' temp_mean_plot[31:35] 2008-02-13 2008-02-14 2008-02-15 2008-02-18 2008-02-19 14.86834 14.89609 14.89358 14.87610 14.87652 The sample runs from Jan 2008 to July 2010. How can I

[R] problem with setRepositories

2010-10-25 Thread Carson, John
When I call setRepositories() I get an error Error in aa[aa == ] - repos[new][aa == ] : NAs are not allowed in subscripted assignments Does anyone know how to fix this? Thanks, John Internet Email Confidentiality Footer Privileged/Confidential Information

[R] question in using nlme and lme4 for unbalanced data

2010-10-25 Thread Chi Yuan
Hello: I have an two factorial random block design. It's a ecology experiment. My two factors are, guild removal and enfa removal. Both are two levels, 0 (no removal), 1 (removal). I have 5 blocks. But within each block, it's unbalanced at plot level because I have 5 plots instead of 4 in each

Re: [R] problem with setRepositories

2010-10-25 Thread Duncan Murdoch
On 25/10/2010 3:09 PM, Carson, John wrote: When I call setRepositories() I get an error Error in aa[aa == ]- repos[new][aa == ] : NAs are not allowed in subscripted assignments Does anyone know how to fix this? What version of R are you using? What does

Re: [R] Chron object in time series plot

2010-10-25 Thread Gabor Grothendieck
On Mon, Oct 25, 2010 at 3:01 PM, Manta mantin...@libero.it wrote: I would like to thank you all for the help given so far! I have the following object of the class 'zoo' temp_mean_plot[31:35] 2008-02-13 2008-02-14 2008-02-15 2008-02-18 2008-02-19  14.86834   14.89609   14.89358   14.87610  

  1   2   >