[R] find CP

2010-03-12 Thread assaedi76 assaedi76
R users   Thanks in advance:   I need to use the function mle.cp in R.  When I run this function I recive   result - mle.cp(y.hald~x.hald) Error: could not find function mle.cp  could some one  give me a help?   thanks [[alternative HTML version deleted]]

Re: [R] find CP

2010-03-12 Thread Tobias Verbeke
Hi, assaedi76 assaedi76 wrote: Thanks in advance: I need to use the function mle.cp in R. When I run this function I recive result - mle.cp(y.hald~x.hald) Error: could not find function mle.cp could some one give me a help? There is a function of that name in the wle package. Make

[R] Return one value, print another

2010-03-12 Thread Joshua Wiley
Dear R users, I am stuck trying to figure out how to make a function return one value and print another.  Here is an example function: ## eg - function(x, digits=4) { xbar - mean(x) sdx - sd(x) value - list(xbar, sdx) names(value) - c(Mean of X, SD of X) return(value)}

Re: [R] VAR with contemporaneous effects

2010-03-12 Thread Pfaff, Bernhard Dr.
Dear Mitch, have you taken a look at ?SVAR in package (vars), though the inclusion of exogenous variables is currently not supported. In principle, your model form is a simultaneous interdependent multiple equation model. For estimating these kind of models have a look at the package systemfit

Re: [R] Return one value, print another

2010-03-12 Thread Dieter Menne
Joshua Wiley-2 wrote: I am stuck trying to figure out how to make a function return one value and print another.  Here is an example function: .. see below My current solution has been to round the variables before putting The easiest way out, e.g. for a lecture, is to use

Re: [R] rmaxwell in C

2010-03-12 Thread Dieter Menne
王杰彪 wrote: How can I generate a random sample from Maxwell Distribution in C language? Since I know the function rmaxwell {VGAM}, I tried the function r2c {r2c}. But I still cannot find the source code. The source code can be downloaded from (or choose your local mirror)

Re: [R] construct a list that consists of lists

2010-03-12 Thread Jim Lemon
On 03/12/2010 05:13 PM, Zhongyi Yuan wrote: Dear R users: I am hoping that someone can help with constructing a list that consists of list with the number of lists variable. i.e. to find a convenient express(or loop sentences) to realize the following: list( list(para1=p1, para2=p2),

[R] Creating named lists

2010-03-12 Thread Rune Schjellerup Philosof
I often find myself making lists similar to this list(var1=var1, var2=var2) It doesn't seem list has an option, to make it use the name of the variable as name in the list. Is there another function that does this? -- Med venlig hilsen Rune Schjellerup Philosof Ph.d-stipendiat,

[R] Contingent Valuation Method estimation function

2010-03-12 Thread Ulrich Morawetz
Hello, I have been teaching a part of a lecture on Valuation Methods of Natural Resources where I covered contingent valuation method. Students collected data using a double-bounded contingent valuation method questioning technique and we analysed them with a very simple logLikelihood estimation

Re: [R] Creating named lists

2010-03-12 Thread Linlin Yan
Did you mean this: n - c('a', 'b') structure(list(1, 2), names = n) $a [1] 1 $b [1] 2 On Fri, Mar 12, 2010 at 5:28 PM, Rune Schjellerup Philosof rphilo...@health.sdu.dk wrote: I often find myself making lists similar to this list(var1=var1, var2=var2) It doesn't seem list has an option,

Re: [R] Creating named lists

2010-03-12 Thread Rune Schjellerup Philosof
No, I mean this: a - 1 b - 2 list(a=a, b=b) I just find it anoying, that I have to type the names of the variables twice. I would like something like this instead: list(a, b, use.var.names=TRUE) -- Rune Linlin Yan wrote: Did you mean this: n - c('a', 'b') structure(list(1, 2), names =

Re: [R] mixed-effects survival

2010-03-12 Thread Dieter Menne
HAKAN DEMIRTAS wrote: What R libraries should I use to implement mixed effects models with continuous time and discrete-time survival data? What if I have two crossed random effects? I'd appreciate any help. Terry Therneau's package coxme. Dieter -- View this message in context:

Re: [R] simple plot in ggplot2, wrong error bars

2010-03-12 Thread ONKELINX, Thierry
Dear Beto, The code below gives a correct result. library(ggplot2) df - data.frame( trt = factor(c(intact, intact, removed, removed)), coon = c(0.093, 0.06, 0.057, 0.09), group = factor(c(veget, fruit, veget, fruit)), se = c(0.01, 0.01, 0.02, 0.026)) ggplot(df,

Re: [R] Creating named lists

2010-03-12 Thread Gesmann, Markus
I think, you are looking for ?llist in the package Hmisc. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rune Schjellerup Philosof Sent: 12 March 2010 09:46 To: Linlin Yan Cc: r-help@r-project.org Subject: Re: [R] Creating named

Re: [R] Creating named lists

2010-03-12 Thread Erich Neuwirth
If thats what you want, why don't you do list(a=1, b=2) On 3/12/2010 10:45 AM, Rune Schjellerup Philosof wrote: No, I mean this: a - 1 b - 2 list(a=a, b=b) I just find it anoying, that I have to type the names of the variables twice. I would like something like this instead: list(a, b,

Re: [R] Error Running TinnR with R

2010-03-12 Thread teck-corp
Hi, I use Windows Vista, downloaded the new version (2.3.5.0) of Tinn-R and followed the advise to change a part in the Rprofile.site and now have #=== # R: general options

[R] Length as fun.aggregate in cast function of reshape package: unexpected error

2010-03-12 Thread David Wyllie
Dear Everyone, I am having problems with use of the reshape package's cast function using length as an aggregating function. Unexpectedly, I receive the error: 2 arguments passed to 'length' which requires 1 I don't understand this at all - the data I'm using is very simple, and appears

Re: [R] Length as fun.aggregate in cast function of reshape package: unexpected error

2010-03-12 Thread jim holtman
'length' does not have an argument 'na.rm=TRUE' that you are trying to pass to it. If you want to remove NAs from the 'length' result, you would write your own function usning na.omit: x - c(1,2,3,NA,4,5,NA,6) length(x) [1] 8 length(na.omit(x)) [1] 6 cast(testdata, ~., function(x)

Re: [R] Creating named lists

2010-03-12 Thread Rune Schjellerup Philosof
Because I was simplifying the use case to make an example. The variables are often created during various computations in functions and in order to return more than one value from a function I have to create a list. Wrapping everything in a list statement would make it harder to read and make

Re: [R] Creating named lists

2010-03-12 Thread Miguel Porto
Hi See if this function works for you (I didn't properly test it...): nlist=function(...) { a=list(...); names(a)=as.character(match.call()[2:(length(a)+1)]) return(a); } Ex: a=1:3 b=matrix(1:10,nc=2) nlist(a,b) $a [1] 1 2 3 $b [,1] [,2] [1,]16 [2,]27 [3,]

Re: [R] Variable arguments to function

2010-03-12 Thread ManInMoon
But it doesn't say much - is there comprehensive documentation anywhere else? -- View this message in context: http://n4.nabble.com/Variable-arguments-to-function-tp1587907p1590402.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] tm[,-1]

2010-03-12 Thread ManInMoon
Thanks for all the replies guys - I think I get it now! -- View this message in context: http://n4.nabble.com/tm-1-tp1588804p1590282.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Help on getting help from manuals

2010-03-12 Thread ManInMoon
Hi, A number of people have suggested I read the manuals... Could someone help me by telling me where the primary start point is please? For example, I am interested in writing functions with variable number of arguments - where should I start to look? An introduction to R only show a brief

Re: [R] Variable number of arguments to function

2010-03-12 Thread ManInMoon
Brian, You say See cbind etc. How would I do that? -- View this message in context: http://n4.nabble.com/Variable-number-of-arguments-to-function-tp800843p1590399.html Sent from the R help mailing list archive at Nabble.com. __

[R] using xval in mvpart to specify cross validation groups

2010-03-12 Thread Andrew Dolman
Dear R's I'm trying to use specific rather than random cross-validation groups in mvpart. The man page says: xval Number of cross-validations or vector defining cross-validation groups. And I found this reply to the list by Terry Therneau from 2006 The rpart function allows one to give the

Re: [R] Creating named lists

2010-03-12 Thread Søren Højsgaard
Rune, I doubt that this is possible because R-objects will typically not know their own name. Med venlig hilsen / Regards Søren Højsgaard -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af Rune Schjellerup Philosof Sendt: 12.

[R] looking for a package to solve current-voltage equation I=f(I)

2010-03-12 Thread PtitBleu
Hello, I'm looking for a R-package to solve such an equation : http://n4.nabble.com/file/n1590462/iv.png which is one current-voltage equation of a solar cell. Thanks in advance, Ptit Bleu. -- View this message in context:

Re: [R] Help on getting help from manuals

2010-03-12 Thread Claudia Beleites
ManInMoon wrote: Hi, A number of people have suggested I read the manuals... Could someone help me by telling me where the primary start point is please? In R, type help.start () this should open a browser window with links to - the packages - the manuals - a search engine Please note: this

Re: [R] Help on getting help from manuals

2010-03-12 Thread Nutter, Benjamin
As has been pointed out, there are tools in R to help find the commands you are looking for. As a practical note, I recommend starting with '?' if you think you know what command you need. If you're unsure of what command you need, my next step would be help.search(). Often, the results from

Re: [R] Help on getting help from manuals

2010-03-12 Thread Kevin E. Thorpe
Claudia Beleites wrote: ManInMoon wrote: Hi, A number of people have suggested I read the manuals... Could someone help me by telling me where the primary start point is please? In R, type help.start () this should open a browser window with links to - the packages - the manuals - a search

Re: [R] Creating named lists

2010-03-12 Thread Rune Schjellerup Philosof
It is possible. Miguel Porto gave a fine example. Søren Højsgaard skrev: Rune, I doubt that this is possible because R-objects will typically not know their own name. Med venlig hilsen / Regards Søren Højsgaard -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org

Re: [R] Creating named lists

2010-03-12 Thread Duncan Murdoch
On 12/03/2010 7:20 AM, Søren Højsgaard wrote: Rune, I doubt that this is possible because R-objects will typically not know their own name. Objects don't know their own name, but functions can find out everything about how they were called. So something like this would come close:

Re: [R] Installing R cmdr

2010-03-12 Thread John Fox
Dear Ista, Thanks for responding to Taleb's message. I already answered him privately, not realizing that his message was also sent to r-help, and suggesting that Tcl/Tk was probably not installed on his system or was installed incorrectly. There are some instructions relating to Tcl/Tk in the

Re: [R] Creating named lists

2010-03-12 Thread Henrique Dallazuanna
One option is this: eapply(globalenv(), I)[c('a', 'b')] On Fri, Mar 12, 2010 at 6:45 AM, Rune Schjellerup Philosof rphilo...@health.sdu.dk wrote: No, I mean this: a - 1 b - 2 list(a=a, b=b) I just find it anoying, that I have to type the names of the variables twice. I would like

Re: [R] Error Running TinnR with R

2010-03-12 Thread stephen's mailinglist account
On 12 March 2010 10:17, teck-corp d.tu...@maastrichtuniversity.nl wrote: Hi, I use Windows Vista, downloaded the new version (2.3.5.0) of Tinn-R and followed the advise to change a part in the Rprofile.site and now have #=== # R:

Re: [R] please, cant install rodbc into R-project

2010-03-12 Thread Marc Schwartz
On Mar 12, 2010, at 12:58 AM, maysider wrote: I have working unixODBC (tested isql), but rodbc does not want to installIve read the manual how to install rodbc, but I am not linux user so I do not understand well. Can anyone write me the necessary steps? thank you m

Re: [R] NAs and row/column calculations

2010-03-12 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.03.2010 00:20:39: On 12/03/2010, at 11:25 AM, Jim Bouldin wrote: I continue to have great frustrations with NA values--in particular making summary calculations on rows or cols of a matrix containing them. For example, why

Re: [R] find CP

2010-03-12 Thread Peter Konings
Try to find the package it belongs to: RSiteSearch('mle.cp') which shows you there is an mle.cp function in the wle package. You need to install and load this first. On Fri, Mar 12, 2010 at 9:00 AM, assaedi76 assaedi76 assaed...@yahoo.comwrote: R users Thanks in advance: I need to use

Re: [R] Return one value, print another

2010-03-12 Thread Miguel Porto
Hmm... do something like that, no need to change the global option (I used a named vector instead of a list, it's more convenient): eg - function(x, digits=4) { xbar - mean(x) sdx - sd(x) value - c(xbar, sdx) names(value) - c(Mean of X, SD of X) print(round(value,digits));

Re: [R] Return one value, print another

2010-03-12 Thread Dieter Menne
Miguel Porto wrote: Hmm... do something like that, no need to change the global option (I used a named vector instead of a list, it's more convenient): eg - function(x, digits=4) { xbar - mean(x) sdx - sd(x) value - c(xbar, sdx) names(value) - c(Mean of X, SD of X)

Re: [R] Return one value, print another

2010-03-12 Thread Miguel Porto
Yeah that's right; in that case implementing the print.myclass as you say would be the best option. Miguel On Fri, Mar 12, 2010 at 2:17 PM, Dieter Menne dieter.me...@menne-biomed.dewrote: Miguel Porto wrote: Hmm... do something like that, no need to change the global option (I used a

Re: [R] Error Running TinnR with R

2010-03-12 Thread teck-corp
Hi Stephen, Thanks a lot for your answer. Unfortunately this does not work for me neither. Could you maybe let me know what is written in you RprofileSite-file now? Best Dennis -- View this message in context: http://n4.nabble.com/Error-Running-TinnR-with-R-tp876004p1590576.html Sent from the

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
rmaxwell() depends on rgamma(), so what you actually need is to download R source (rgamma() might depend further on other functions, though). library(VGAM) rmaxwell function (n, a) { if (!is.Numeric(n, posit = TRUE, allow = 1)) stop(bad input for argument 'n') if (any(a = 0))

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
The manual R-exts, section 6.7.1 should help if you want to call rgamma() in C. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2010/3/12 xie x...@yihui.name: rmaxwell()

[R] Form using R

2010-03-12 Thread Nilza BARROS
Hi, R users We can create a form using R? I would like to create a form where the information can be read by R. Itneeds to be updated daily because I have to tabulate the reasons for delays in the generation of numerical models products. I really appreciate any help, Thanks in advance, Nilza

Re: [R] Return one value, print another

2010-03-12 Thread Joshua Wiley
Dieter: I had considered creating a special class, but you are right that it was more than I (really) wanted to do. Setting the global digits option is an excellent suggestion. Thank you. Right now I am working with simple functions mostly to save myself a few steps. Miguel: I did not use

Re: [R] Error Running TinnR with R

2010-03-12 Thread stephen's mailinglist account
On 12 March 2010 14:27, teck-corp d.tu...@maastrichtuniversity.nl wrote: Hi Stephen, Thanks a lot for your answer. Unfortunately this does not work for me neither. Could you maybe let me know what is written in you RprofileSite-file now? Best Dennis -- View this message in context:

Re: [R] Error Running TinnR with R

2010-03-12 Thread Keith Jewell
Many people seem to have trouble defining '.trPaths' which is the set of file names which TinnR uses to communicate with R; the user must be able to create/write/read these files/folders. In my Rprofile.site I have the single assingment: .trPaths - paste(paste(Sys.getenv(APPDATA),

[R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Jack Luo
Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? Thanks, -Jack [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Redirect/pipe output to less

2010-03-12 Thread Ali Tofigh
I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to view large objects (matrices/dataframes etc) using less. This is preferable to redirecting output to

Re: [R] Help on getting help from manuals

2010-03-12 Thread Patrick Burns
A new resource along these lines is: Some hints for the R beginner http://www.burns-stat.com/pages/Tutor/hints_R_begin.html If you have ideas on how to improve on it, please let me know. Pat On 12/03/2010 09:41, ManInMoon wrote: Hi, A number of people have suggested I read the manuals...

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Steve Lianoglou
Hi, On Fri, Mar 12, 2010 at 11:09 AM, Jack Luo jluo.rh...@gmail.com wrote: Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? I don't really understand what you're trying to ask, but does upper.tri

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Marc Schwartz
On Mar 12, 2010, at 10:09 AM, Jack Luo wrote: Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? Thanks, -Jack Try setting the 'lower.panel' argument to NULL. Compare: pairs(USJudgeRatings)

Re: [R] looking for a package to solve current-voltage equation I=f(I)

2010-03-12 Thread Mario Valle
?optim RSiteSearch(nonlinear equation solver) CRAN task view (optimization) Do a little work for your own before asking other to work for you. mario On 12-Mar-10 13:25, PtitBleu wrote: Hello, I'm looking for a R-package to solve such an equation :

Re: [R] Redirect/pipe output to less

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 11:15 AM, Ali Tofigh wrote: I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to view large objects (matrices/dataframes etc)

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-12 Thread Xie Chao
On Wed, Mar 10, 2010 at 6:13 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: not with the theme, as far as I know, but you can do: set_default_scale(fill, discrete,grey) Can I set default shape in similar way? I tried this: set_default_scale(shape, discrete, 19) Error in

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Marc Schwartz
I am not seeing an immediately evident way of doing that. Bear in mind that pairs() is essentially a wrapper to automate the process of using par(mfrow = c(rows, columns)) and setting other graphical parameters such as margins, which sets up the grid of individual plots within the overall

[R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
Dear R users, I have two data frames that were read from text files as follows: x_data - read.table(x.txt, header = TRUE, sep = |, quote = \', dec = .,as.is = TRUE,na.strings = NA,colClasses = NA, nrows = 3864284, skip = 0, check.names = TRUE,fill=TRUE,

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Greg Snow
Is this what you want? pairs(iris[,-5], lower.panel=NULL) Also look at the pairs2 function in the TeachingDemos package for a way to plot one set of variables against another set. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Can you show the output of dput(x_data) and dput(y_data). On Fri, Mar 12, 2010 at 11:56 AM, Newbie19_02 nvanzuy...@gmail.com wrote: Dear R users, I have two data frames that were read from text files as follows: x_data - read.table(x.txt, header = TRUE, sep = |, quote = \',                

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Gabor Grothendieck
Try the View command. On Fri, Mar 12, 2010 at 11:15 AM, Ali Tofigh alix.tof...@gmail.com wrote: I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
http://n4.nabble.com/file/n1590804/feb09_267_presc_items_tsf.txt feb09_267_presc_items_tsf.txt is the total file for y so if I use the command line with the total data for y then I get the output specified in z Thanks, Natalie -- View this message in context:

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
dput(x_data) structure(list(prochi = c(CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713), prescribed_date = c(22/06/2001, 28/04/2000, 10/04/2000, 03/07/2000, 09/01/2001, 16/10/2001, 16/08/2001, 17/09/1993, 01/05/2001,

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
y_data - read.table(feb_267_presc_items_tsf.txt, header = TRUE, sep = |, quote = \', dec = .,as.is = TRUE,na.strings = NA,colClasses = NA, nrows = 3864284, skip = 0, check.names = TRUE,fill=TRUE, strip.white = TRUE, blank.lines.skip = TRUE,

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Please provide code that I can just copy from your post and paste into my session. Either provide dput output as requested or provide the files on the internet together with code that reads them off the internet. On Fri, Mar 12, 2010 at 12:06 PM, Newbie19_02 nvanzuy...@gmail.com wrote:

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
What about y_data? On Fri, Mar 12, 2010 at 12:14 PM, Newbie19_02 nvanzuy...@gmail.com wrote: dput(x_data) structure(list(prochi = c(CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713), prescribed_date = c(22/06/2001,

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
The y_data file has over 9000 rows in it so I thought it would be more practical to give you the file to download -- View this message in context: http://n4.nabble.com/sqldf-not-joining-all-the-fields-tp1590786p1590833.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] sqldf not joining all the fields

2010-03-12 Thread David Winsemius
You have now given two different assignments to x_data and none to y_data: The str( from the file access offering: str(x_data) 'data.frame': 2848 obs. of 5 variables: $ item_code : int 100 110 150 160 161 164 200 210 212 220 ... $ name: chr NEONACLEX K NEONACLEX

Re: [R] Help on getting help from manuals

2010-03-12 Thread Greg Snow
For programming you should start with Writing R Extensions (just scan the sections that don't apply to you yet). I would also recommend S poetry by Patrick Burns (http://www.burns-stat.com/) and S Programming by Venables and Ripley. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
Sorry! It is the end of the day for me. So dput(x) structure(list(prochi = c(CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713), prescribed_date = c(22/06/2001, 28/04/2000, 10/04/2000, 03/07/2000, 09/01/2001, 16/10/2001,

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Yes, its not clear what data was used. Please provide a single email that contains code that can be copied from R and pasted into another session that will reproduce the problem. x_data - ...dput output goes here... y_data - dput output goes here ... library(sqldf) ... rest of code ... or else:

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
Sorry! It is the end of the day for me. So dput(x) structure(list(prochi = c(CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713, CAO713), prescribed_date = c(22/06/2001, 28/04/2000, 10/04/2000, 03/07/2000, 09/01/2001, 16/10/2001,

Re: [R] looking for a package to solve current-voltage equation I=f(I)

2010-03-12 Thread Berend Hasselman
On 12-03-2010, at 13:25, PtitBleu wrote: Hello, I'm looking for a R-package to solve such an equation : http://n4.nabble.com/file/n1590462/iv.png which is one current-voltage equation of a solar cell. ?uniroot Berend __

Re: [R] sqldf not joining all the fields

2010-03-12 Thread David Winsemius
If I assign the file input to y_data and change you sqldf to z - sqldf(select * from x_data left join y_data using (item_code)); z I can replicate your result. Even after changing the types of the two item_code fields to match I still get the same result and when I see to what degree

[R] invalid connection with pipe()

2010-03-12 Thread Ali Tofigh
After using pipe() to view output in less, the pipe becomes invalid: $ p - pipe(less) $ capture.output(1:100, file=p) $ p Error in summary.connection(x) : invalid connection $ close(p) Error in close.connection(p) : invalid connection Is this a bug? Other uses of pipe works differently: $ p -

Re: [R] construct a list that consists of lists

2010-03-12 Thread Zhongyi Yuan
Hi Jim, Dennis Murphy solved my problem by the following code. Thank you for you suggestion. Will check out listBuilder function too. best, Zhongyi # (2) A little more general: prespecify the number of list components # and run a one-line loop to populate the list l - vector('list', 6)

[R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
-- Forwarded message -- From: Natalie Van Zuydam nvanzuy...@gmail.com Date: Fri, Mar 12, 2010 at 5:49 PM Subject: Re: [R] sqldf not joining all the fields To: David Winsemius dwinsem...@comcast.net Dear David I'm not sure what the problem is as for every item code there is a

Re: [R] construct a list that consists of lists

2010-03-12 Thread Henrique Dallazuanna
You can do this also, using replicate: replicate(6, list(para1 = 1:5, para2 = 5:9), simplify = FALSE) On Fri, Mar 12, 2010 at 2:51 PM, Zhongyi Yuan zhongyi-y...@uiowa.edu wrote: Hi Jim, Dennis Murphy solved my problem by the following code. Thank you for you suggestion. Will check out

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
That is not so. 842752 does not exist in y$item_code and ASPIRIN has a code of 22730. 842752 %in% y$item_code [1] FALSE subset(y, name == ASPIRIN) item_codename formulation_code strength bnf_code 850 22730 ASPIRIN TABS300MG4.7.1 855 22780 ASPIRIN

Re: [R] construct a list that consists of lists

2010-03-12 Thread Zhongyi Yuan
Hi Henrique, Great. I tried a similar thing but used list( replicate(6, list(para1 = 1:5, para2 = 5:9), simplify = FALSE) ) and didn't work. Seems I don't need list(...). Thanks. Zhongyi On Fri, Mar 12, 2010 at 11:56 AM, Henrique Dallazuanna www...@gmail.comwrote: You can do this also, using

Re: [R] Help with aggregate and cor

2010-03-12 Thread James Marca
On Wed, Mar 10, 2010 at 12:08:52AM -0800, hvollmeier wrote: James, you may post your question to the R-SIG finance group with a small example. If I understand your problem correctly it's like converting tick data of financial time series into aggregates. (to 1-minute, hourly, daily ...

Re: [R] Error Running TinnR with R

2010-03-12 Thread jim holtman
These are some of the reasons I have stuck with version 1.19.4.7 of Tinn-R; it still works fine. On Fri, Mar 12, 2010 at 10:09 AM, stephen's mailinglist account stephen4mailingli...@googlemail.com wrote: On 12 March 2010 14:27, teck-corp d.tu...@maastrichtuniversity.nl wrote: Hi Stephen,

[R] Getting multiple matrix-values using a single command

2010-03-12 Thread Nils Rüfenacht
Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A - matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a single command and without using any loop? My first idea was to generate a row- and a

[R] Usage of apply function with two matrices

2010-03-12 Thread Michal Szewczyk
Hello, I am struggling to overcome following problem: I have matrix Vf and matrix V, which both have 3 columns and I want to create a spline function basing on coordinates from this matrices (more precisely coordinates of function nr 1: x are taken from Vf[,1] and y are taken from V[,1]

[R] Likelihood Optimization With Categorical Variables

2010-03-12 Thread Dr. Federico Andreis
Dear all, I have the following problem: I have been using the routine optim in order to maximize a joint likelihood (basically a mixture with modeled weights) with quantitative variables..so far so good. Now I need to plug into the model a categorical variable (namely, age classes).

[R] Exporting animation of a series of plots

2010-03-12 Thread Flana
Hi All, Thank you in advance for your help. I made an agent-based model in R and I plot it using image() each timestep creating a nice animation. I can't seem to find in any of the R codes a means to export the series of images so that they can be played as a movie or animation. Thank you

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread Claudia Beleites
use a matrix of n x 2 to index. For details: sec. 5.3 Index matrices in the introduction. HTH Claudia Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A - matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
842752|ASPIRIN DISP AAH|TABS|75MG|2.9 is taken directly from my y_data text file. If I search for ASPIRIN DISP AAH %in% y$name I get: FALSE. Despite the fact that it is there in the text file that I loaded into y. There must be a problem with my input. tsf_data -

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread Henrique Dallazuanna
Try this: diag(A[c(1,3),c(2,3)]) 2010/3/12 Nils Rüfenacht nils.ruefena...@bluewin.ch: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A - matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a

Re: [R] Form using R

2010-03-12 Thread Nilza BARROS
It would be a form that is filled daily, but some fields were tabulated and other fields would be filled with only the opinions of users. Currently, my form is a Word document that is the filling and printed. At the end of every month they are analyzed and the reasons for delays are tabulated and

Re: [R] Exporting animation of a series of plots

2010-03-12 Thread davidr
I think you can use package animation. See http://animation.yihui.name/ . HTH, David L. Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Flana Sent: Friday, March 12, 2010 12:14 PM To: r-help@r-project.org Subject: [R]

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
Hi, I did quote the string and as I told read.table to strip.white I also tried it with no spaces. ASPIRIN DISP AAH %in% tsf_data$name [1] FALSE ASPIRINDISPAAH %in% tsf_data$name [1] FALSE I have looked at the last lines of my y_data object and there is a problem with the file that I'm going

Re: [R] Form using R

2010-03-12 Thread Bert Gunter
Sounds like a job for sweave or perhaps one of the packages brew or odfWeave. See also the xtable package, perhaps. You would then be able to: -- read the latest data file -- have R produce all tabular summaries, analyses, plots -- output all the results in a nicely formatted template (report)

Re: [R] Error Running TinnR with R

2010-03-12 Thread Jeff Laake
I'm considering going back to that version (or switching to Eclipse) because the newer Tinn-R version requires pacakges Tinn-r and Hmisc and something is aliasing functions in xtable which blows up my Sweave runs. For the time being I'm using cut-paste. On 3/12/2010 10:41 AM, jim holtman

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ted Harding
Another approach may be useful. Back in May 2003 I raised a similar query: How to divert R output into a separate X window (in Linux) where it would apear after being piped through 'less'. This has the advantage that, if you choose to do it this way, it leaves your R console untouched. I raised

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 9:26 AM, Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A - matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a single command and without using

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 2:31 PM, David Winsemius wrote: On Mar 12, 2010, at 9:26 AM, Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A - matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ali Tofigh
On Fri, Mar 12, 2010 at 14:27, Ted Harding ted.hard...@manchester.ac.uk wrote: However, all that was a long time ago. Check 'page' in your newer R! Thanks for the tip. But I don't understand what page is supposed to do. For example, page(1:3) simply displays the text string 1:3 in less. And

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 2:15 PM, Natalie Van Zuydam wrote: Hi, I did quote the string and as I told read.table to strip.white I also tried it with no spaces. ASPIRIN DISP AAH %in% tsf_data$name [1] FALSE ASPIRINDISPAAH %in% tsf_data$name [1] FALSE I have looked at the last lines of my y_data

[R] Data frame question

2010-03-12 Thread apjaworski
Hi, I have the following question about creating data frames. I want to create a data frame with 2 components: a vector and a matrix. Let me use a simple example: y - rnorm(10) x - matrix(rnorm(150), nrow=10) Now if I do dd - data.frame(x=x, y=y) I get a data frame with 16 colums, but if,

  1   2   >