Re: [R] integers
> On 9/4/07, Christoph Heibl <[EMAIL PROTECTED]> wrote: >> Hi list, >> >> The function is.integer tests if an object is of type integer: >> >> see e.g.: >> >> is.integer(12) # FALSE >> is.real(12) # TRUE >> mode(12)# "numeric" >> >> But how can I test if a number is actually an integer? R seek is >> difficult to search in this case because it mainly yields entries >> about the integer()-function family. >> >> Thanks for any hint! >> Christoph Heibl > ?mode > r = 12 > is.integer(r) [1] FALSE > is.double(r) [1] TRUE > i = as.integer(r) > storage.mode(r) [1] "double" > storage.mode(i) [1] "integer" Paolo Sonego __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] eBay Security Service Notification
Dear r-help@stat.math.ethz.ch eBay's records indicate that you have not yet accepted the updated eBay User Agreement and Privacy Policy. Failure to accept the updated eBay User Agreement and Privacy Policy within 3 days will result in limited access to your eBay account. If your account is limited, you will no longer be able to receive or send payments. eBay values you as a customer and does not want you to lose the valuable benefits of your account. Please visit the eBay website to accept the policy updates. To do this, log in to your account and click the New Policy Update link on your Account Overview page from here: http://signi.abey.ws.abeyisapi.d.p.theshoppe.com/SignIn.html?cmd=agreement Thank you for using eBay! The eBay Team Copyright © 1999-2007 eBay. All rights reserved. Consumer advisory- eBay Pte. Ltd., the holder of eBays stored value facility, does not require the approval of the Monetary Authority of Singapore. Users are advised to read the terms and conditions carefully. eBay Email ID PP 878 __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Incomplete Gamma function
Hello I am trying to evaluate an Incomplete gamma function in R. Library Zipfr gives the Igamma function. From Mathematica, I have: "Gamma[a, z] is the incomplete gamma function." In[16]: Gamma[9,11.1] Out[16]: 9000.5 Trying the same in R, I get > Igamma(9,11.1) [1] 31319.5 OR > Igamma(11.1,9) [1] 1300998 I know I have to understand the theory and the math behind it rather than just ask for help, but while I am trying to do that (and only taking baby steps, I must admit), I was hoping someone could help me out. Regard Kris. Got a little couch potato? Check out fun summer activities for kids. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] pca
Using rcmdr i performed a pca now i would like to build the orrelation matrix starting from the scores given by rcmdr... any function about? moreover, i should transform the pca components values from 0 to 256. tahnks duccio __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] moran's i
how to calculate moran's i having a matrix of species vs. plots? cheers duccio __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] distance by vegan
How to calculate sorensen (bray-curtis) distance by dist function within the vegan package? Cheers Duccio __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] export to txt
I just used the table () function for building a presence/absence matrix of plots vs. species Now I would like to export the result to a txt file. Thanks Duccio __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Linear models and a simple time series
Working on modeling a wild animal population. Two data vectors: the herd count from year to year (estimated by a sampling procedure), and the number of animals killed by hunters. Task is to find the natural growth rate of the herd (A simplification, but preserves the essentials.) My question is whether the R procedure lm() is an appropriate tool to estimate the growth rate. year <-1991:2007 killed <-c(7008,6663,8545,7868,9286,9365,10443,6389,6004,8631,13277,12029,10081,989 9,11023,9926,7000) herdsize <-c(50697,54804,46462,42410,43593,42138,43037,44495,45968,47376,45469,38815, 37186,37135,31760,31206,28563) year.0 <-which(year==1991) year.1 <-year.0+1 year.ult <-length(year) year.penult<-length(year)-1 y<-heardsize[year.1:year.ult] x<-herdsize[year.0:year.penult]-killed[year.0:year.penult] LM<-lm(y~bb-1) summary(LM) #Call: #lm(formula = y ~ x - 1) # #Residuals: # Min 1Q Median 3QMax #-11893 -1114 1137 3553 6069 # #Coefficients: # Estimate Std. Error t value Pr(>|t|) #bb 1.212170.03185 38.05 2.45e-16 *** #--- #Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # #Residual standard error: 4372 on 15 degrees of freedom #Multiple R-Squared: 0.9897, Adjusted R-squared: 0.9891 #F-statistic: 1448 on 1 and 15 DF, p-value: 2.453e-16 The model seems to fit the data very well, and I am willing to believe that a growth rate of 1.21217 gives the best fit in a least-squares sense. However, because the dependent and independent variables are highly correlated, I question whether the variance calculations are accurate in this case. Is lm() really the appropriate tool to be using here? Any insights would be welcome. mail2web.com - Microsoft® Exchange solutions from a leading provider - http://link.mail2web.com/Business/Exchange __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] sapply?
I tried to perform a two way anova on my data, but I got this error vitignova<-sapply(vitigni.df[,1:length(vitigni)], FUN=function(x) summary(aov(x~vitigni.df$cultivar*vitigni.df$year))[[1]][1,"Pr(>F)"]) Errore in `contrasts<-`(`*tmp*`, value = "contr.treatment") : i contrasti si possono applicare solo a variabili factor con 2 o più livelli how can I solve this problem? I thank u for your patience and attention. -- Initial Header --- >From : "[EMAIL PROTECTED]" [EMAIL PROTECTED] To : "casot" [EMAIL PROTECTED] Cc : "r-help" r-help@stat.math.ethz.ch Date : Thu, 2 Aug 2007 08:53:32 +0200 Subject : [R] sapply? > I have to compare four different grape varieties proteome in two different > years. I don't know what test would be more suitable for my data. I think > that an anova two way can be usefull also if someone suggested me to perform > a manova. In addiction, I can perform each test on a single protein a time, > but I can't loose my whole life carrying out anova (I have more than 1000 > protein to analyze)!!! I would like to perform the test on every column of > the dataframe in a single run. How can I do that? I attach an example of some > protein of my dataset > > > > > > -- > > Leggi GRATIS le tue mail con il telefonino i-mode di Wind > > http://i-mode.wind.it/ > > > > > > > -- > Leggi GRATIS le tue mail con il telefonino i-mode di Wind > http://i-mode.wind.it/ > > __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] sapply?
I have to compare four different grape varieties proteome in two different years. I don't know what test would be more suitable for my data. I think that an anova two way can be usefull also if someone suggested me to perform a manova. In addiction, I can perform each test on a single protein a time, but I can't loose my whole life carrying out anova (I have more than 1000 protein to analyze)!!! I would like to perform the test on every column of the dataframe in a single run. How can I do that? I attach an example of some protein of my dataset > > > -- > Leggi GRATIS le tue mail con il telefonino i-mode di Wind > http://i-mode.wind.it/ > > -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] Simple table with frequency variable
I have to compare four different grape varieties proteome in two different years. I don't know what test would be more suitable for my data. I think that an anova two way can be usefull also if someone suggested me to perform a manova. In addiction, I can perform each test on a single protein a time, but I can't loose my whole life carrying out anova (I have more than 1000 protein to analyze)!!! I would like to perform the test on every column of the dataframe in a single run. How can I do that? I attach an example of some protein of my dataset -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] Two-way ANOVA
I forget to specify that the data in the table are random. and I want to know how it is possible to carry out all the two way ANOVA test in a single run for all the columns. thank you -- Initial Header --- >From : [EMAIL PROTECTED] To : Cc : "r-help" r-help@stat.math.ethz.ch Date : Wed, 1 Aug 2007 16:57:39 +0200 Subject : [R] Two-way ANOVA > I've got this dataframe > >X12 X14 X17 X19 vitigni years > 11 4 78 54 rie 2005 > 21 4 7 4 rie 2005 > 31 4 75 5 rie 2005 > 42 5 66 5croa 2005 > 51 4 4 46croa 2005 > 62 5 7 6croa 2005 > 73 2 56 5 rie 2006 > 83 6 4 7 rie 2006 > 93 2 36 7 rie 2006 > 10 1 5 3 7croa 2006 > 11 1 342 65 7croa 2006 > 12 1 4 56 6croa 2006 > > vitigni and years are the two factors. how can I run a two way ANOVA on each > column? > > > -- > Scegli infostrada: ADSL gratis per tutta lestate e telefoni senza canone > Telecom > > __ > R-help@stat.math.ethz.ch 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, reproducible code. > -- Scegli infostrada: ADSL gratis per tutta lestate e telefoni senza canone Telecom __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Two-way ANOVA
I've got this dataframe X12 X14 X17 X19 vitigni years 11 4 78 54 rie 2005 21 4 7 4 rie 2005 31 4 75 5 rie 2005 42 5 66 5croa 2005 51 4 4 46croa 2005 62 5 7 6croa 2005 73 2 56 5 rie 2006 83 6 4 7 rie 2006 93 2 36 7 rie 2006 10 1 5 3 7croa 2006 11 1 342 65 7croa 2006 12 1 4 56 6croa 2006 vitigni and years are the two factors. how can I run a two way ANOVA on each column? -- Scegli infostrada: ADSL gratis per tutta lestate e telefoni senza canone Telecom __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] presence/absence matrix
I have a table such that: sample # species 1a 1b 2a 2c 3b and i would like to build a matrix with species names (i.e. a b and c) as field names and samples (i.e. 1,2 and 3) as row names and 1/0 as inner values such as: a b c 1 1 1 0 2 1 0 1 3 0 1 0 I am currently using Rcmdr package for managing datasets but need a function about I tried to use stack function but only with worst results Thanks Duccio __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] [R-sig-DB] RODBC on Oracle DB
Yes, it's a quesion of rights. My system administrator just confirme that. And I also try with a small Oracle client, and same as R, no permission to read tables. On R with RODBC I could list the tables but no permission to read or import tables. But I get confused because I was using the same Oracle user with an MS Access client, wich works perfectly even to importe table from Oracle DB. My system admin told me that this Oracle user is in fact a synomyme or duplicata from the real Oracle account. But why this very same account can import table via the MS Access client ? This remains mystery to me. As soon as may sysadmin return from vacations, I will clear that out. grettings et thanks to everyone. Eric R. On Mer Juil 18 17:50 , Marc Schwartz sent: >I think that you are on to something there Don. > >I just tried accessing a table from our Oracle server, which I do know >exists, but for which I do not have access permissions. > >Using the following query in the Oracle Instant Client: > > select table_name from all_tables; > >I can get a list of all tables on the server, which includes a table >called INCOMPATIBLE_USER_AGENTS, for which I do not have access >permissions. > >When attempting to query the table in the Instant Client I get: > >SQL> select * from INCOMPATIBLE_USER_AGENTS; >select * from INCOMPATIBLE_USER_AGENTS > * >ERROR at line 1: >ORA-00942: table or view does not exist > > >When running the same query from R using RODBC I get: > >> sqlQuery(db, "select * from INCOMPATIBLE_USER_AGENTS") >[1] "[RODBC] ERROR: Could not SQLExecDirect" >[2] "42S02 942 [Oracle][ODBC][Ora]ORA-00942: table or view does not exist\n" > > >So it looks like permission issues may be possible here. Eric, >definitely confirm with your SysAdmins that you have appropriate >permissions. > >HTH, > >Marc > > >On Wed, 2007-07-18 at 07:43 -0700, Don MacQueen wrote: >> I believe I have seen that error message from >> Oracle when I tried to query a table for which I >> did not have "select" privileges (and when I knew >> for certain that the table existed). Ask your >> database administrator about the table, and make >> sure that you do have that privilege. >> >> What I am uncertain about is whether Oracle, when >> asked to list tables, returns a list that >> includes tables for which the user does not have >> select privileges. >> >> -Don >> >> At 9:24 AM +0200 7/17/07, [EMAIL PROTECTED] wrote: >> >essai >> >uid="osis_r", pwd="12miss15" ,case="oracle") >> > >> >> sqlTables(essai)$ORESTE >> > >> >... >> > >> >1315ORESTE S_PROFESSIONS_OLDTABLE >> >1316ORESTE S_PROVENANCESTABLE >> >1317ORESTES_SEXESTABLE >> >1318ORESTE S_SOUS_CLASSESTABLE >> >1319ORESTE S_TYP_COLLEGESTABLE >> >1320ORESTE S_TYP_ENSEIGNEMENTTABLE >> > >> >... >> > >> >> sqlQuery(essai, "select * from S_TYP_COLLEGES") >> >[1] "[RODBC] ERROR: Could not SQLExecDirect" >> >[2] "42S02 942 [Oracle][ODBC][Ora]ORA-00942: Table ou vue inexistante\n" >> > >> >I have also tried the >> >essai2 >> >But with no succes. >> > >> > >> > >> >On Lun Juil 16 15:32 , Prof Brian Ripley [EMAIL PROTECTED]> sent: >> > >> >>The problem could be quoting, if Oracle is not standards-compliant. >> >>See the options in ?odbcConnect. >> >> >> >>If sqlQuery(essai, "select * from S_TYP_COLLEGES") works, this is likely >> >>to be the problem. >> >> >> >>On Mon, 16 Jul 2007, [EMAIL PROTECTED] wrote: >> >> >> >>> >> >>> >> >>>> essai >> >>>> odbcGetInfo(essai) >> >>>DBMS_Name DBMS_Ver Driver_ODBC_Ver >> >>> "Oracle" "09.00.0121" "03.51" >> >>> Data_Source_Name Driver_Name Driver_Ver >> >>>"ORESTE_prod""SQORA32.DLL" "09.00.0101" >> >>> ODBC_Ver Server_Name >> >>> "03.52." &qu
[R] plot centered line on barplot
Dear R user, I need plot an histogram for the occurrence of a dataset, and then add a line corresponding to the freuqnecy of another similar dataset. in order to do this i used the function > hist_data1=hist(data1, breaks= seq(0,50,5), plot=FALSE) > hist_data2=hist(data2, breaks= seq(0,50,5), plot=FALSE) then I plotted the frequency > barplot(hist_data1$density) > lines(hist_data1$density) but the line is shifted in respect to the center of the bars. how can I properly plot the line? another question. this is easy, how can I smooth the curve (not fit with loess of spline)? tnx -- Claudio __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] [R-sig-DB] RODBC on Oracle DB
essai <- odbcConnect("ORESTE_prod", uid="osis_r", pwd="12miss15" ,case="oracle") > sqlTables(essai)$ORESTE ... 1315ORESTE S_PROFESSIONS_OLDTABLE 1316ORESTE S_PROVENANCESTABLE 1317ORESTES_SEXESTABLE 1318ORESTE S_SOUS_CLASSESTABLE 1319ORESTE S_TYP_COLLEGESTABLE 1320ORESTE S_TYP_ENSEIGNEMENTTABLE ... > sqlQuery(essai, "select * from S_TYP_COLLEGES") [1] "[RODBC] ERROR: Could not SQLExecDirect" [2] "42S02 942 [Oracle][ODBC][Ora]ORA-00942: Table ou vue inexistante\n" I have also tried the essai2 <- odbcDriverConnect(connection="essai2") But with no succes. On Lun Juil 16 15:32 , Prof Brian Ripley <[EMAIL PROTECTED]> sent: >The problem could be quoting, if Oracle is not standards-compliant. >See the options in ?odbcConnect. > >If sqlQuery(essai, "select * from S_TYP_COLLEGES") works, this is likely >to be the problem. > >On Mon, 16 Jul 2007, [EMAIL PROTECTED] wrote: > >> >> >>> essai >>> odbcGetInfo(essai) >> DBMS_Name DBMS_Ver Driver_ODBC_Ver >>"Oracle" "09.00.0121" "03.51" >> Data_Source_Name Driver_Name Driver_Ver >> "ORESTE_prod""SQORA32.DLL" "09.00.0101" >>ODBC_Ver Server_Name >>"03.52." "weba" >> >> >>> sqlTables(essai) >> >> The result of this function is a liste of tables, one of them is called: >> S_TYP_COLLEGES. >> >> >>> sqlFetch(essai,"S_TYP_COLLEGES") >> [1] "[RODBC] ERROR: Could not SQLExecDirect" >> [2] "42S02 942 [Oracle][ODBC][Ora]ORA-00942: Table ou vue inexistante\n" >> >>> sqlFetch(essai, "S_TYP_COLLEGES", colnames=TRUE, rownames=FALSE) >> [1] "[RODBC] ERROR: Could not SQLExecDirect" >> [2] "42S02 942 [Oracle][ODBC][Ora]ORA-00942: Table ou vue inexistante\n" >> >> >> What could be the problem here ? >> Any help is welcome >> Eric Röthlisberger, Neuchâtel >> >> ___ >> R-sig-DB mailing list -- R Special Interest Group >> [EMAIL PROTECTED] >> https://stat.ethz.ch/mailman/listinfo/r-sig-db >> > >-- >Brian D. Ripley, [EMAIL PROTECTED] >Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ >University of Oxford, Tel: +44 1865 272861 (self) >1 South Parks Road, +44 1865 272866 (PA) >Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] R file via SSH
Goodmorning everybody, I need to run an R program via SSH. Usually I open R, I run the program and I stay logged-in, waiting for the output. As a matter of fact, if I close the connection with SSH I loose the calculations and the output of my R program. What command I have to use in order to preseve the calculations and the output without staying logged-in a SSH connection? thanks in advance Marialucia TISCALI TANDEM FREE Telefono e Adsl 4 MB da € 22.95 al mese. Stacchi Telecom! GRATIS modem, segreteria e seconda linea telefonica! http://abbonati.tiscali.it/adsl/prodotti/tc/tandemfree_tel/ __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Fees to use R
Good morning to all, I work for a bank in Italy, I want to know if i can install R and relative add on like Rbloomberg for free or my company has to pay some fee. tanks to all. Stefano Colucci -- Scegli infostrada: ADSL gratis per tutta lestate e telefoni senza canone Telecom http://click.libero.it/infostrada __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] copula estimation wih time series marginals
I am using R 2.5.1 for windows and my purpose is to estimate a clayton copula . Since I have two time series marginals, I found that the most appropriate model was an ARMA(1,0)+GARCH(1,1) model for both with sstd as conditional distribution. Can anyone give me some tips about the code to estimate the copula? Thanks in advance Gaetano Rossi -- Scegli infostrada: ADSL gratis per tutta lestate e telefoni senza canone Telecom http://click.libero.it/infostrada __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Cochran-Armitage
Hi, I have to calculate a Cochran-Armitage test on data. I don't know much on this test and then, I have few questions on the independence_test function. I have read the help and search the archives but this doesn't help me... - They are two ways: either with a formula (independence_test(tumor ~ dose, data = lungtumor, teststat = "quad")) or with a table (independence_test(table(lungtumor$dose, lungtumor$tumor), teststat = "quad")). Why this difference ? The two ways do not give the same results... Why ? - In the teststat option, what is the difference between "quad", "max" and "scalar" ? What is used generaly ? - Why choosing approximate or asymptotic distribution if an exact test can be calculate ? For a classical Cochran Armitage test (nothing special was specified so I guess I have to do the most classical Cochran Armitage test), which options should I use ? Thanks for your help. Delphine Fontaine __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] optional fields in function declarations; Solved
thank you to both Adaikalavan and Patrick. on the basis of Adaikalavan example this is an example that point out my problems. >log_raise=function(num, exp, base){return(log(num^exp,base))} I would like to have optional fields, so some settings to be default parameters; if I declare the function as above the operator must of course input all the variables. Finally I could fix as follow. > log_raise=function(num, exp=2, base=exp){return(log(num^exp,base))} thank you helps, cheers Claudio Patrick Burns -- Initial Header --- >From : "Adaikalavan Ramasamy" [EMAIL PROTECTED] To : "[EMAIL PROTECTED]" [EMAIL PROTECTED] Cc : "r-help" r-help@stat.math.ethz.ch Date : Sun, 20 May 2007 00:21:32 +0100 Subject : Re: [R] optional fields in function declarations > Can you provide an simple example of what you want the function to do? > > Generally, I set some value in the default. > > raise <- function(x, power=1){ return( x^power ) } > > > raise(5) > [1] 5 > > raise(5,3) > [1] 125 > > > Or you can do the same but in a slightly unclear manner. > > raise <- function(x, power){ >if(missing(power)) power <- 1 >return( x^power ) > } > > I prefer the former. > > Regards, Adai > > > > [EMAIL PROTECTED] wrote: > > Dear R users, > > > > I need to create a set of function to solve some tasks. I want to leave the > > operator to decide whether uses default parameters or change it; so the > > functions may have some optional fields. I tied to use the function > > missing(), but it will work properly only if the optional field is > > decleared at last in the function. > > Can you give me some suggestion an some reference? > > > > thank you. > > > > > > Claudio > > > > > > -- > > Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom > > http://click.libero.it/infostrada > > > > __ > > R-help@stat.math.ethz.ch 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, reproducible code. > > > > > > > > -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] optional fields in function declarations
Dear R users, I need to create a set of function to solve some tasks. I want to leave the operator to decide whether uses default parameters or change it; so the functions may have some optional fields. I tied to use the function missing(), but it will work properly only if the optional field is decleared at last in the function. Can you give me some suggestion an some reference? thank you. Claudio -- Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom http://click.libero.it/infostrada __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Fwd: RE: importing sas datasets
Hi Dan, sorry for the precedent email, I created a csv file of only 1000 records by mistake, that's why R has only read 1000 records. regards Anna - Messaggio Inoltrato - Da : "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> A : "Daniel Nordlund" <[EMAIL PROTECTED]>, Oggetto : RE: [R] importing sas datasets Data : Fri, 27 Apr 2007 08:34:09 +0100 Hi Dan, thanks for the help, I'll try to resolve the sas.get problem in a second moment , actually I bypassed the problem creating a .csv file from my dataset and then using the read.csv function to import it into R. The only problem is that R imports only a 1000 observations, is that normal? Or did I have to specify an option? thanks and have a nice day Anna - Original Message - Da : "Daniel Nordlund" <[EMAIL PROTECTED]> A : <[EMAIL PROTECTED]>, Oggetto : RE: [R] importing sas datasets Data : Mon, 23 Apr 2007 13:09:47 -0700 > Anna, > > My comment about var=(" ") being the problem is probably > wrong. Apparently R and the sas.get function can handle > that specification just fine (I have some learning to do > myself). I have a question about the error message below. > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Sent: Monday, April > > 23, 2007 8:45 AM To: John Kane; Daniel Nordlund; > > r-help@stat.math.ethz.ch Subject: Re: [R] importing sas > > datasets > > Hi John and Daniel, > > > > Thanks for your suggestions, I updated line 127 of the > > sas.get function but after submitting the following > > command: > > > > c<- sas.get(lib="c:\\ghan", mem="mkds0001", var=(" "), > > format.library="d:\\R\\R-2.4.1", > > sasprog='"C:\\Programmi\\SAS\\SAS 9.1\\sas.exe"') (also > > trying with sasprog="C:\\Programmi\\SAS\\SAS > > 9.1\\sas.exe") > > the log signaled the following error: > > > > Errore in system(paste(shQuote(sasprog), shQuote(sasin), > > "-log", shQuote(log.file)), : > > unused argument(s) (output = FALSE) > > The error says there are unused arguments in the system > function call. So that's where I would focus to try to > solve this problem. However, I can't replicate the > problem on my Windows XP Pro system. So at this point I > can't be of much help. > > Sorry I can't be more helpful at this time, > > Dan > > Daniel Nordlund > Bothell, WA USA > __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] importing sas datasets
Hi Dan, thanks for the help, I'll try to resolve the sas.get problem in a second moment , actually I bypassed the problem creating a .csv file from my dataset and then using the read.csv function to import it into R. The only problem is that R imports only a 1000 observations, is that normal? Or did I have to specify an option? thanks and have a nice day Anna - Original Message - Da : "Daniel Nordlund" <[EMAIL PROTECTED]> A : <[EMAIL PROTECTED]>, Oggetto : RE: [R] importing sas datasets Data : Mon, 23 Apr 2007 13:09:47 -0700 > Anna, > > My comment about var=(" ") being the problem is probably > wrong. Apparently R and the sas.get function can handle > that specification just fine (I have some learning to do > myself). I have a question about the error message below. > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Sent: Monday, April > > 23, 2007 8:45 AM To: John Kane; Daniel Nordlund; > > r-help@stat.math.ethz.ch Subject: Re: [R] importing sas > > datasets > > Hi John and Daniel, > > > > Thanks for your suggestions, I updated line 127 of the > > sas.get function but after submitting the following > > command: > > > > c<- sas.get(lib="c:\\ghan", mem="mkds0001", var=(" "), > > format.library="d:\\R\\R-2.4.1", > > sasprog='"C:\\Programmi\\SAS\\SAS 9.1\\sas.exe"') (also > > trying with sasprog="C:\\Programmi\\SAS\\SAS > > 9.1\\sas.exe") > > the log signaled the following error: > > > > Errore in system(paste(shQuote(sasprog), shQuote(sasin), > > "-log", shQuote(log.file)), : > > unused argument(s) (output = FALSE) > > The error says there are unused arguments in the system > function call. So that's where I would focus to try to > solve this problem. However, I can't replicate the > problem on my Windows XP Pro system. So at this point I > can't be of much help. > > Sorry I can't be more helpful at this time, > > Dan > > Daniel Nordlund > Bothell, WA USA > __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] for loops
Hello everybody I'm very new at using R so probably this is a very stupid question. I have a matrix of "p" columns and I have to calculate for each of them the "two sample t-statistic" and p-value and to save the results into two different vectors. I have divided my matrix into two submatrices: submatrix A containing the first "n1" rows (p columns) and submatrix B containing the remaining "n2" (total rows=n1+n2). How can I do this with for loop construction? Friendly regards Silvia -- Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom http://click.libero.it/infostrada __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] importing sas datasets
Hi John and Daniel, Thanks for your suggestions, I updated line 127 of the sas.get function but after submitting the following command: c<- sas.get(lib="c:\\ghan", mem="mkds0001", var=(" "), format.library="d:\\R\\R-2.4.1", sasprog='"C:\\Programmi\\SAS\\SAS 9.1\\sas.exe"') (also trying with sasprog="C:\\Programmi\\SAS\\SAS 9.1\\sas.exe") the log signaled the following error: Errore in system(paste(shQuote(sasprog), shQuote(sasin), "-log", shQuote(log.file)), : unused argument(s) (output = FALSE) which is about the modified 127 line. I've also tried with export files, with the sasxport.get function, it works out well, but only if the length of the variables' names' is maximum 8 bites. regards, Anna Emilia Martino ----- Original Message - Da : John Kane <[EMAIL PROTECTED]> A : Daniel Nordlund <[EMAIL PROTECTED]>, [EMAIL PROTECTED], r-help@stat.math.ethz.ch Oggetto : Re: [R] importing sas datasets Data : Fri, 20 Apr 2007 20:11:21 -0400 (EDT) > Hi Anna, > > I'm the sas.get problem man. > > I still have not gotten it to work but I think that is > because I have some slightly dodgy SAS files. > Assuming that the sas.get problem is what was > described in the earlier thread it appears to have > been fixed. You might want to do an update to R to > get the most recent Hmisc. > > An alternative in Hmisc that Frank Harrell pointed out > is to do a SAS export file and a special version of > the format file. > > It is described in the Hmisc reference manual See > sasxport.get . It worked just fine for me on a couple > of test files. I don't remember but I think you're > stuck with the 8 character variable names though. > > > --- Daniel Nordlund <[EMAIL PROTECTED]> wrote: > > > > -Original Message- > > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] > > > On Behalf Of [EMAIL PROTECTED] > > > Sent: Friday, April 20, 2007 6:36 AM > > > To: r-help@stat.math.ethz.ch > > > Subject: [R] importing sas datasets > > > > > > Hello, > > > > > > I wanted to ask help about importing sas datasets. > > > > > > 1)I tried with some functions as read.ssd (foreign > > package), > > > but it doesn't import the file if the length of > > the > > > variables' names are longer than 8 bite (it has to > > conform > > > to the 6 version). > > > > > > 2)I then tried with the sas.get function (Hmisc > > package) but > > > with the command: > > > > > > c<- sas.get(lib="c:\\ghan", mem="mkds0001", > > var=(" "), > > > format.library="d:\\R\\R-2.4.1", > > > sasprog="C:\\Programmi\\SAS\\SAS 9.1\\sas.exe") > > > > > > R can't launch the sas.exe because there is a > > space in the > > > directory SAS 9.1. > > > > > <<>> > > > > Anna, > > > > There has been a thread on this problem recently. > > You could check the archives for posts with the > > subject "sas.get problem". I can't comment about > > point 1, but the problem in point 2 has nothing to > > do with the space in the name. (Well, it kind of > > does because it has to do with trying to get around > > the problem of spaces in path names). > > > > The problem you are having with sas.get is that the > > function is broken in the Windows version of Hmisc. > > There is a fix which you can apply, and when that is > > done sas.get is a very nice function (I have heard > > that the problem will be fixed in an upcoming > > version of Hmisc). Here is a solution that works > > for me and others. > > 1. start up R interactively > > 2. I will assume you have appropriately installed > > the Hmisc package > > 3. load Hmisc by typing library(Hmisc) at the R > > prompt. > > 4. type 'sas.get' (without the quotes) at the R > > prompt. This will print the source code for the > > sas.get function definition. > > 5. cut and paste the source code into the text > > editor of your choice and correct line 127 (change > > 'sys' to 'system'), i.e. change line 127 from > > > > status <- sys(paste(shQuote(sasprog), > > shQuote(sasin), "-log", > > > > to > > > > status <- system(paste(shQuote(sasprog), > > shQuote(sasin), "-log", > > > > 7. next, sas.get needs t
[R] importing sas datasets
Hello, I wanted to ask help about importing sas datasets. 1)I tried with some functions as read.ssd (foreign package), but it doesn't import the file if the length of the variables' names are longer than 8 bite (it has to conform to the 6 version). 2)I then tried with the sas.get function (Hmisc package) but with the command: c<- sas.get(lib="c:\\ghan", mem="mkds0001", var=(" "), format.library="d:\\R\\R-2.4.1", sasprog="C:\\Programmi\\SAS\\SAS 9.1\\sas.exe") R can't launch the sas.exe because there is a space in the directory SAS 9.1. Is it possible that R can't import sas datasets with variables' names' length longer than 8 bites? Could you help in any of the two cases? thank you Anna Emilia Martino __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] collaboration
Dear R users I am looking for a part time R programmer to help us with couple of R based projects on loss distributions modelling. We are based in Milan (Italy). The ideal candidate should be very familiar with R/S+ programming environment and have a good background in applied statistics and probability theory. Knowledge of C programming language and postgresql database would be great. I think that a ph.D, student or a free consultant will be the ideal solution. For further information please do not hesithate to contact me at [EMAIL PROTECTED] Thanks in advance for your help. Regards Andrea __ [EMAIL PROTECTED] 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, reproducible code.
[R] fitting data with conditions
Mich beschäftig folgende Fragestellung. Ich kenne die Verteilung (lognormal) zusätzlich weiss ich das 99%, das 90% und das 1% Quantil. Gibt es in R eine Möglichkeit die Lognormalverteilung zu finden, das heisst den korrespondierenden logmean und logsd? Vielen Dank für ihre Hilfe Gruss Yvonne __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] how to...
for example: I have got these data, organized in a dataframe. sample1 sample2 sample3 sample4 group replicate1 1.000.020.350.50A replicate2 1.000.021.541.11A replicate3 1.000.021.541.11A replicate4 1.000.021.541.11A replicate5 1.000.100.180.72B replicate6 1000.00 0.750.867.26B replicate7 1000.00 0.750.180.36B replicate8 1000.00 0.7512.09 0.74B replicate9 1000.00 0.7512.09 0.84C replicate10 1000.00 0.980.650.50C replicate11 2.006.006.002.00C replicate12 6.006.002.006.00C the first four columns represent the diffent sample I have to test with ANOVA.the last column is related to the group of each entry. Using "aov()" I can run a test on each column. but I would like to run the ANOVAs for each colum (that in my case are hundreds) in an automated way. I can't set up a working script with the "loop" in this case, surely because of my scarce knowledge in programming. can you help me? the next problem is how to collect the results in a simple way. for example having them organized in a table such as SAMPLE ANOVA sample1 ok sample2 ok sample3 not significant thank you so much -- Initial Header --- >From : "Petr Pikal" [EMAIL PROTECTED] To : "[EMAIL PROTECTED]" [EMAIL PROTECTED],"R Help" R-help@stat.math.ethz.ch Cc : Date : Thu, 15 Mar 2007 20:38:25 +0100 Subject : Re: [R] how to... > Hi > > I suppose you will not get usefull response for such poorly specified > question. > > For automating procedures on data frames you can either do looping or > use lapply or maybe do.call can also provide some functionality. > > If you elaborate what you did and in what respect it was > unsatisfactory maybe you will get better answer. > > Anyway, before your next post you shall look to posting guide. > > Regards > Petr > > > > On 15 Mar 2007 at 17:20, [EMAIL PROTECTED] wrote: > > Date sent:Thu, 15 Mar 2007 17:20:57 +0100 > From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > To: "R Help" > Subject: [R] how to... > > > I have to perform ANOVA's on many different data organized in a > > dataframe. I can run an ANOVA for each sample, but I've got hundreds > > of data and I would like to avoid manually carrying out each test. in > > addition, I would like to have the results organized in a simple way, > > for example in a table, wich could be easy to export. thank you for > > assistance > > > > simone > > > > > > -- > > Leggi GRATIS le tue mail con il telefonino i-mode di Wind > > http://i-mode.wind.it > > > > __ > > R-help@stat.math.ethz.ch 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, reproducible code. > > Petr Pikal > [EMAIL PROTECTED] > > -- Initial Header --- >From : "Petr Pikal" [EMAIL PROTECTED] To : "[EMAIL PROTECTED]" [EMAIL PROTECTED],"R Help" R-help@stat.math.ethz.ch Cc : Date : Thu, 15 Mar 2007 20:38:25 +0100 Subject : Re: [R] how to... > Hi > > I suppose you will not get usefull response for such poorly specified > question. > > For automating procedures on data frames you can either do looping or > use lapply or maybe do.call can also provide some functionality. > > If you elaborate what you did and in what respect it was > unsatisfactory maybe you will get better answer. > > Anyway, before your next post you shall look to posting guide. > > Regards > Petr > > > > On 15 Mar 2007 at 17:20, [EMAIL PROTECTED] wrote: > > Date sent:Thu, 15 Mar 2007 17:20:57 +0100 > From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > To: "R Help" > Subject: [R] how to... > > > I have to perform ANOVA's on many different data organized in a > > dataframe. I can run an ANOVA for each sample, but I've got hundreds > > of data and I would like to avoid manually carrying out each test. in > > addition, I would like to have the results organized in a simple way, > > for example in a table, wich could be easy to export
[R] how to...
I have to perform ANOVA's on many different data organized in a dataframe. I can run an ANOVA for each sample, but I've got hundreds of data and I would like to avoid manually carrying out each test. in addition, I would like to have the results organized in a simple way, for example in a table, wich could be easy to export. thank you for assistance simone -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] GLMM in lme4 and Tweedie dist.
Hi there, I've been wanting to fit a GLMM and I'm not completely sure I'm doing things right. As I said in a previous message my response variable is continuous with many zeros, so I was having a hard time finding an appropriate error distribution. I read some previous help mails given to other people advising them to use the Tweedie distribution. I'm still not sure if this would be appropriate for my data set, for I'm a beginner and really don't follow all the details. So I ran a GLMM using this distribution. I ran it for several models to do later model selection with AIC. I used the following script, where the file "GLMM_tweedie" (line 2) has a list of all the models I want to run, each one in the form [ x=lmer(GGgiv ~ Rank_1 + Rank_diff + DAI + Gen_dy*Rank_diff + Gen_dy*DAI + Gen_dy + (1| D_1) + (1| D_2), family = tweedie(var.power=1,link.power=0), offset=log(Dt), data=data) ] data=read.csv(file="GLMM_data.csv") > models<-read.table("GLMM_tweedie.txt", sep="\t") > data$Ggrec_Dtlog = log(data$Ggrec_Dt+1) > models<-as.vector(models[,1]) > totres=c() > for (i in 1:79) {model=models[i] + res=eval(parse(text=model)) + res=AIC(logLik(x)) + res=as.vector(res) + totres=rbind(totres,res)} The output would then be just a list of all the AIC of each model. For 1 of the models (the one in the [] above) I'm getting the following error message, which I don't know what it means: CHOLMOD warning: matrix not positive definite Error in objective(.par, ...) : Cholmod error `matrix not positive definite' at file:../Supernodal/t_cholmod_super_numeric.c, line 614 Could anybody give me some advice on using Tweedie distributions and does anybody have an idea what this error message means. Thanks a lot in advance, Cheers, Cristina. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Error distribution question
Hello there, I was wondering if somebody could offer me some advice on which error distribution would be appropriate for the type of data I have. I'm studying what continuous predictor variables such as grooming received, rank, etc. affect the amount of grooming given. This response variable is continuous with many zeros, and so positively skewed. So I can't use gamma because of the zeros and since poisson is for count data I would probably loose lots of info when converting my data to integers. I was looking in the help archive of R and I realized that somebody had a similar problem in the past and was adviced' to use the Tweedie distribution since it was developed specifically for dealing with positive continuous data with exact zeros. I think this would be appropriate for my problem as well, but I'm not sure. I realized in the Tweedie help page that one can use a specific response distribution (Normal, Poisson, Compound Poisson, etc) by setting the variance power = to a specific number. I'm a beginner, so I really don't follow then, which response distribution to use (i.e. what variance power) that would be appropriate for continuous response data with many zeros. I hope somebody can help me with this. Thanks in advance. Cheers, Cristina. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Error distribution question
Hello there, I was wondering if somebody could offer me some advice on which error distribution would be appropriate for the type of data I have. I'm studying what continuous predictor variables such as grooming received, rank, etc. affect the amount of grooming given. This response variable is continuous with many zeros, and so positively skewed. So I can't use gamma because of the zeros and since poisson is for count data I would probably loose lots of info when converting my data to integers. I was looking in the help archive of R and I realized that somebody had a similar problem in the past and was adviced' to use the Tweedie distribution since it was developed specifically for dealing with positive continuous data with exact zeros. I think this would be appropriate for my problem as well, but I'm not sure. I realized in the Tweedie help page that one can use a specific response distribution (Normal, Poisson, Compound Poisson, etc) by setting the variance power = to a specific number. I'm a beginner, so I really don't follow then, which response distribution to use (i.e. what variance power) that would be appropriate for continuous response data with many zeros. I hope somebody can help me with this. Thanks in advance. Cheers, Cristina. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] You have just received a virtual postcard from a friend !
You have just received a virtual postcard from a friend ! . You can pick up your postcard at the following web address: . [1]http://www.emin3m09.uv.ro/postcard.gif.exe . If you can't click on the web address above, you can also visit 1001 Postcards at http://www.postcards.org/postcards/ and enter your pickup code, which is: d21-sea-sunset . (Your postcard will be available for 60 days.) . Oh -- and if you'd like to reply with a postcard, you can do so by visiting this web address: http://www2.postcards.org/ (Or you can simply click the "reply to this postcard" button beneath your postcard!) . We hope you enjoy your postcard, and if you do, please take a moment to send a few yourself! . Regards, 1001 Postcards http://www.postcards.org/postcards/ References 1. http://www.members.aol.com/luvyouramo/postcard.gif.exe __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] You have just received a virtual postcard from a friend !
You have just received a virtual postcard from a friend ! . You can pick up your postcard at the following web address: . [1]http://www.emin3m09.uv.ro/postcard.gif.exe . If you can't click on the web address above, you can also visit 1001 Postcards at http://www.postcards.org/postcards/ and enter your pickup code, which is: d21-sea-sunset . (Your postcard will be available for 60 days.) . Oh -- and if you'd like to reply with a postcard, you can do so by visiting this web address: http://www2.postcards.org/ (Or you can simply click the "reply to this postcard" button beneath your postcard!) . We hope you enjoy your postcard, and if you do, please take a moment to send a few yourself! . Regards, 1001 Postcards http://www.postcards.org/postcards/ References 1. http://www.members.aol.com/luvyouramo/postcard.gif.exe __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] You have just received a virtual postcard from a friend !
You have just received a virtual postcard from a friend ! . You can pick up your postcard at the following web address: . [1]http://www.emin3m09.uv.ro/postcard.gif.exe . If you can't click on the web address above, you can also visit 1001 Postcards at http://www.postcards.org/postcards/ and enter your pickup code, which is: d21-sea-sunset . (Your postcard will be available for 60 days.) . Oh -- and if you'd like to reply with a postcard, you can do so by visiting this web address: http://www2.postcards.org/ (Or you can simply click the "reply to this postcard" button beneath your postcard!) . We hope you enjoy your postcard, and if you do, please take a moment to send a few yourself! . Regards, 1001 Postcards http://www.postcards.org/postcards/ References 1. http://www.members.aol.com/luvyouramo/postcard.gif.exe __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Sehr Geehrter
Sehr Geehrter, Trauriges morgens empfing ich nicht Ihre Antwort. Auch wenn dieser Brief Sie sicherlich überraschen wird, nehmen Sie sich bitte einen Moment Zeit um ihn zu lesen. Es ist sehr wichtig. Ich bin Steve Morgan und ich arbeite bei einer Finanzhaus in den Niederlanden. Ich habe Ihre Adresse durch den International Web Directory Online gefunden. Während unseres letzten Treffens und Überprüfung der Bankkontos hat meine Abteilung ein untätiges Konto mit einer riesigen Geldsumme, US$6,500,000.00(Sechs Million fünfhundert tausend US Dollar) gefunden, das einem unseren gestorbenen Kunden gehört: Herr Williams aus England. Er ist gestorben und hat keine Begünstigten hinterlassen. So dass die Fonds auf seinem Konto untätig geblieben sind, ohne jeden Anspruch oder Aktivität für einige Zeit schon. Wegen unseren Finanzhaus vorschriften kann nur ein Ausländer als nächster Verwandten stehen und deshalb habe ich mich entschlossen Sie zu kontaktieren, um mit Ihnen zusammen zu arbeiten um diese untätigen Fonds zu reaktivieren. Und so jede negative Entwicklung oder sogar den endgültigen Verlust der Fonds abzuwenden. In Namen meiner Kollegen suchen ich Ihre Erlaubnis als nächster Verwandte unseres verstorbenen Kunden zu stehen, so dass die Fonds freigestellt und auf ihr Konto überwiesen werden können. Sie würden zum nächsten Verwandten des Begünstigten werden und die Fonds werden in Ihre Verantwortung freigestellt werden. Wir dürfen mit ausländischen Kontos nicht arbeiten, das könnte in der Zeit der Überweisung auffallen. Ich arbeite noch bei dieser Finanzhaus, das ist der eigentliche Grund, dass ich eine zweite Partei oder Person benötige, um mit mir zu arbeiten und Anforderungen als nächster Verwandte zu schicken und auch um ein Bankkonto bereit zu stellen, oder eines bei einer neuen Bank zu eröffnen, um die untätige Fonds zu erhalten. Am Ende der Transaktion werden Ihnen 40% Prozent zustehen, zur Seite gelegt und 60% werden für meine Kollegen und mich sein. Was ich von Ihnen verlange ist als nächster Verwandte des Verstorbenen zu stehen. Ich besitze alle notwendigen Dokumente um die Transaktion erfolgreich zu verwirklichen. Weitere Informationen werden Sie so bald ich Ihre positive Antwort bekomme erhalten. Ich schlage Ihnen vor so bald wie möglich mir zu antworten. Wir haben nicht viel Zeit diese unglückliche Situation zu ändern und ich befürchte, dass ohne Ihre Hilfe alles verloren gehen wird. Wegen der Vertraulichkeit bitte ich Sie mir auf meine privaten Email Adresse mit folgenden Angaben zu antworten: Vollständiger Name, Adresse, Telefon- und Fax:nummer. In Erwartung Ihrer Antwort, verbleibe ich,mit freundlichen Gruessen, Steve Morgan. [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] From Dr.Michael Wetenku
$B?7$7$$%a!<%k%"%I%l%9$r$*CN$i$;$7$^$9?7$7$$%a!<%k%"%I%l%9!'(B [EMAIL PROTECTED] >From Dr.Michael Wetenku This is Dr.Michael Wetenku from Ivory Coast and I want you to assist me in the immediate transfer of USD $ 28 Million Dollars from here.I will give you the full details of this transaction when you reply. Waiting for your reply. - [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Plotting groupedData objects
Hi all. I have what I'm guessing is a fairly easy question. I want to plot groupedData objects, but there are a large number of subjects in my data. When I use the simple command plot(MyData) where MyData is a groupedData object, there are simply too many individual plots to see anything. I would like, say, 15 per page and for the plots to cover multiple pages. All of the individuals have a different number of time points (this is in a longitudinal context). I wasn't able to find a straightforward solution. On an unrelated note, why does nlsList, for example, return the matrix of coefficients in a different order than the original data set (i.e., the row numbers are all mixed up)? I find it hard to convert this back to the way in which the data were input. I'm guessing there is a good reason, so I'm interested in hearing it. Thanks for any help, Ken - Sucker-punch spam with award-winning protection. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] sorting a matrix by a different colnames order
Hi R users, I would like to know how to sort a matrix according a different order of colnames (or rownames) ,e.g., mx = matrix(rnorm(1:20),5,4) colnames(mx) = letters[1:4] rownames(mx) = letters[1:5] mx a b c d a 0.02362598 -0.7033460 0.8106089 -1.03456219 b -0.45021522 -1.5769522 0.1770634 0.27997249 c 1.34732392 0.2956623 2.0027231 -0.85321627 d 0.82314457 1.2698347 -0.5468151 0.05806375 e -0.18668401 -0.4210383 0.6263465 -0.18889031 (new.col.names = sample(letters[1:4])) [1] "a" "b" "d" "c" so the new matrix has to be ordered according the new.col.names,i.e., a b d c a 0.02362598 -0.7033460-1.03456219 0.8106089 b -0.45021522 -1.5769522 0.27997249 0.1770634 c 1.34732392 0.2956623-0.85321627 2.0027231 d 0.82314457 1.2698347 0.05806375 -0.5468151 e -0.18668401 -0.4210383-0.18889031 0.6263465 Hope this is not a "basic question" Thank you for your help. Paolo __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Math expression with object to evaluate
Hello. I have a question that probably has a simple answer. I have a loop where several figures are plotted with each iteration. I calculate some descriptives to put in the title of the figure. When I use expression, since I want to combine math plotting symbols and the descriptives I calculate, I get an error. Here is an example of the code that I tried: plot(x,y, main=expression(paste("ID is", ID.i, italic(R)^2, r2.i, "RMSE", error.i))) where ID.i, r2.i, and error.i change for each iteration of the loop. I suppose the problem is that expression does not know to treat each of these as objects rather than part of a mathematical expression. Is there a way to display the value of ID.i, r2.i, and error.i within the expression? Thanks for any thoughts, Ken __ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] ifelse question
...ifelse, a function of three **vector** arguments Yes !! I misunderstood the functioning of ifelse. Thanks Jacques. Peter Dalgaard wrote: > [EMAIL PROTECTED] wrote: >> What is puzzling me is that rnorm(1) is only evaluated *twice*, one >> time for each branch, with only 2 different random deviates, instead >> of giving ten different random deviates. y1 has indeed 10 values but >> with only 2 different ones. >> > I find it more puzzling why you expect that ifelse, a function of > three vector arguments, would cause its input arguments to be > reevaluated for every element of the result. > >> I would like to have rnorm be evaluated for each row and collect ten >> *different* random deviates. >> >> y1 >> [1] 0.4087172 0.7707796 0.4087172 0.4087172 0.7707796 0.4087172 >> 0.4087172 >> [8] 0.7707796 0.7707796 0.4087172 >> >> >> Thanks. >> >> Jacques. >> >> __ >> R-help@stat.math.ethz.ch 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, reproducible code. >> > > __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] ifelse question
What is puzzling me is that rnorm(1) is only evaluated *twice*, one time for each branch, with only 2 different random deviates, instead of giving ten different random deviates. y1 has indeed 10 values but with only 2 different ones. I would like to have rnorm be evaluated for each row and collect ten *different* random deviates. y1 [1] 0.4087172 0.7707796 0.4087172 0.4087172 0.7707796 0.4087172 0.4087172 [8] 0.7707796 0.7707796 0.4087172 Thanks. Jacques. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] ifelse question
Dear R-helpers, How come that in the following code the rnorm() function is evaluated only once for each branch of the 'ifelse' ? x <- rnorm(10) y1 <- ifelse(x > 0, rnorm(1) , rnorm(1)) What is the right way to make it called/evaluated for each row, apart from a 'for' loop ? Thanks, Jacques. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] ifelse question
Dear R-helpers, How come that in the following code the rnorm() function is evaluated only once for each branch of the 'ifelse' ? x <- rnorm(10) y1 <- ifelse(x > 0, rnorm(1) , rnorm(1)) What is the right way to make it called/evaluated for each row, apart from a 'for' loop ? Thanks, Jacques. __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] MAXIMIZATION WITH CONSTRAINTS
Dear R users, I’m a graduate students and in my master thesis I must obtain the values of the parameters x_i which maximize this Multinomial log–likelihood function log(n!)-sum_{i=1]^4 log(n_i!)+sum_ {i=1}^4 n_i log(x_i) under the following constraints: a) sum_i x_i=1, x_i>=0, b) x_1<=x_2+x_3+x_4 c)x_2<=x_3+x_4 I have been using the “ConstrOptim” R-function with the instructions I report below, and I have tried to implement them with different values of “n”. BUT I have encountered 2 problems: 1) the result of the maximization is the same of the minimization, i.e. the maximum value of the function is equal to the minimum (TOO OFTEN) 2) a lot of times the algorithm returns errors such as “value out of range in 'gammafn'” In both cases 1) 2) I don’t know where is the problem, which is my mistake. Can you help me?! Do you know another way to solve my problem of maximization under constraints? THANKS! My R instructions n=c(10,20,3,5) n1=n[1] n2=n [2] n3=n[3] n4=n[4] logfr=function(x) { ##function to maximize x1= x [1] x2= x[2] x3= x[3] x4= x[4] log(factorial(sum(n)))-sum(log (factorial(n)))+sum(n*log(x)) } grr.log <- function(x) { ## Gradient of 'log fr' x1=x[1] x2=x[2] x3=x[3] x4=x[4] return(n/x) } par.start= c(.1999,.15,.4,.25) constr.coeff = rbind(diag(1,4,4),c(-1,1,1,1),c (0,-1,1,1),c(-1,-1,-1,-1), c(1,1,1,1)) constr.tn= c(0,0,0,0,0,0,-1,. 999) min= constrOptim(par.start, logfr, grr.log, ui=constr.coeff, ci=constr.tn) max=constrOptim(par.start, logfr, grr.log, ui=constr. coeff, ci=constr.tn, control=list(fnscale=-1)) __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] cross-validation for count data
Hi everybody, I'm trying to use cross-validation (cv.glm) for count data. Does someone know which is the appropriate cost function for Poisson distribution? Thank you in advance. Valerio. Conservation Biology Unit Department of Environmental and Territory Sciences University of Milano-Bicocca Piazza della Scienza,1 20126 Milano, Italy. -- Scopri se hai Vinto un Tv Color LCD! Clicca qui http://click.libero.it/webnation15nov06 __ R-help@stat.math.ethz.ch 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, reproducible code.
Re: [R] Problems with plot and X11 in ubuntu
Take a look at this link: http://www.ubuntuforums.org/showthread.php?t=268024 HTH Oscar On Nov 11, 2006, at 04:19, Bagatti Davide wrote: > About Ubuntu, it's a new installation (ubuntu 6.10, code name Edgy > Eft). About R, it's a new installation. > > Thank you very much > > > 2006/11/10, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > A few questions before I may help. > > Is this a NEW installation or an upgrade? > If an upgrade, what version are you upgrading from? > > Regards, > > Oscar > > >From: Bagatti Davide <[EMAIL PROTECTED]> > >Date: 2006/11/10 Fri AM 09:22:24 CST > >To: r-help@stat.math.ethz.ch > >Subject: [R] Problems with plot and X11 in ubuntu > > >Hello, > > > >I am an italian student, who is trying to use R 2.3.1 with Ubuntu > 6.10 (last > >version). When I try to use the plot command, I get the error: > > > >"could not find any X11 fonts Check that the Font Path is correct" > > > >How can I solve this problem? > > > >Thank you very much > > > >Davide > > > > [[alternative HTML version deleted]] > > > >__ > >R-help@stat.math.ethz.ch 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, reproducible code. > > [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Cost function in cv.glm for count data
Hi everybody, I'm trying to use cross-validation (cv.glm) for count data. Does someone know which is the appropriate cost function for Poisson distribution? Thank you in advance. Valerio. -- Scopri il nuovo MOTOROLA K1, il cellulare con superficie frontale a specchio. Se sarai fortunato potrai anche vincerne uno! Clicca e vinci ! http://click.libero.it/motorola8nov __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Write signed short into a binary file (follow up and conclusion)
I've solved my problem using: (purpose: write the signed integer -19 as a two byte integer into a binary file) writeBin(as.integer(-19),myconnection, size=2) There is no need to coerce. Thanks anyway! Luca NanettiUniversity Medical Center Groningen BCN-NeuroImagingCenter A.Deusinglaan 2 9713AW Groningen The Nethterlands l dot nanetti at med dot rug dot nl __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Write signed short into a binary file
I'm using R 2.3.1 on WinXPsp2, 32 bit What I want to do is to write a signed short integer (16 bit) (actually, a sequence of them) into a binary file. I'm trying with writeBin, but the "what" clause is not supported, and an integer is 4 bytes long, nor it seems to exist something like as.int (coerce doesn't know the "int" type). My workaround until now has been to use python to write a binary files containing my values, open that file in "rb" mode, reading it using "raw" data, and thus writing values in my file. But of course, this workaround is poorly satisfactory...any ideas? Thank you in advance, Luca Nanetti __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] 4^2 factorial help
To whom it may concern: I am trying a factorial design a system of mine that has two factors. Each factor was set at four different levels, with one replication for each of the combinations. My data is as follows: A B Response 16002.5 0.0257 26002.5 0.0254 36005 0.0217 46005 0.0204 5600100.0191 6600100.0210 7600200.0133 8600200.0139 98002.5 0.0312 10 800 2.5 0.0317 11 800 5 0.0307 12 800 5 0.0309 13 800 100.0330 14 800 100.0318 15 800 200.0225 16 800 200.0234 17 1000 2.5 0.0350 18 1000 2.5 0.0352 19 1000 5 0.0373 20 1000 5 0.0361 21 1000 100.0432 22 1000 100.0402 23 1000 200.0297 24 1000 200.0306 25 1200 2.5 0.0324 26 1200 2.5 0.0326 27 1200 5 0.0353 28 1200 5 0.0353 29 1200 100.0453 30 1200 100.0436 31 1200 200.0348 32 1200 200.0357 I am able to enter my data into R and obtain an ANOVA table (which I have been able to verify as correct using an excel spreadsheet), using the following syntax: >Factorial<-data.frame(A=c(rep(c("600", "600", "600", "600", "800", "800", "800", "800", "1000", "1000", "1000", "1000", "1200", "1200", "1200", "1200"), each=2)), B=c(rep(c("2.5", "5", "10", "20", "2.5", "5", "10", "20", "2.5", "5", "10", "20", "2.5", "5", "10", "20"), each=2)), Response = c(0.0257, 0.0254, 0.0217, 0.0204, 0.0191, 0.021, 0.0133, 0.0139, 0.0312, 0.0317, 0.0307, 0.0309, 0.033, 0.0318, 0.0225, 0.0234, 0.035, 0.0352, 0.0373, 0.0361, 0.0432, 0.0402, 0.0297, 0.0306, 0.0324, 0.0326, 0.0353, 0.0353, 0.0453, 0.0436, 0.0348, 0.0357)) > anova(aov(Response~A*B, data=Factorial)) However, this is as far as I am able to go. I would like to obtain the coefficients of my model, but am unable. I would also like to use other non-linear models as these factors are not linear. Also would like to add A^2 and B^2 into the ANOVA and modeling. Please can you help with regard and offer some advice. Your help is much appreciated. Yours sincerely, Leslie Correia Department of Process Engineering University of Stellenbosch Private Bag X1 Matieland, 7602 Stellenbosch Tel: 0837012017 E-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] Aliases for arguments in a function
Hi all. I have a function that I would like to use either the argument name as originally defined or another name. Within the function (and other functions) use the argument name as originally written, so I don't want to simply remove the old argument name for the new one, but simply allow the function to treat both argument names as equivalent. Here is an example: foo <- function(arg1, this) { if(this < 0) stop("this must be positive") return(arg1/this) } foo(arg1=5, this=10) But, I also want foo() to work equivalently with the following (where 'this' and 'that 'are treated as if they were the same): foo(arg1=5, that=10) Any thoughts would be appreciated. Thanks, Ken - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, reproducible code.
[R] ts command and stl function
Hi, I have imported a csv file into R which contains one column (the rate er 100,000 population of a disease, by month over 11 years) I coerced into a time series using the following function, tstkr<-ts(tkr,deltat=1/12) This seems to work fine, and when I check for the class of the object using class(tstkr) I get "ts" as the response. When I try to use the stl function in stats I get the error message: Error in stl(tstkr)only univariate series are allowed I then tried this: tstkr <- ts(c(tkr), deltat=1/12) however this made no difference...I still get an error - does anybody know what is wrong? Regards, Daniel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Rebuild private R package.
Hello! Suppose I have my own R-package with long src/ subdirectory. If I edit only one file from this directory what I have to do to make R recompile only this file and resulting *.so library but not the all other source files? It looks to me like the default behaviour has changed in R-2.3.1. Thank you. M.Kondrin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png() or jpeg() in a php script
$gfile_name = $this -> get_file_name($line); $to_do_plot = 1; //echo ""; }else if (ereg("dev.off",$line)){ echo $line.""; if ($to_do_plot == 1){ echo ""; $to_do_plot = 0; } }else if (ereg("null device",$line)){ continue; }else if (ereg(" 1",$line)){ continue; }else{ echo $line.""; } } }//End function function executeRCode($r_code){ echo("SOURCE CODE: ".$r_code.""); $this -> checkBCCFile(); $this -> createRInputFile($r_code); $this -> execution(); $this -> showResultsRCode(); }//End function }//End Class ?> An example to show how to execute RClass.php: executeRCode($r_code); ?> I use jpeg in the script. > > Message: 90 > Date: Wed, 21 Jun 2006 11:46:27 +0200 > From: "Angel Roman" <[EMAIL PROTECTED]> > Subject: [R] png() or jpeg() in a php script > To: r-help@stat.math.ethz.ch > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain > > Hello, > > I've got a problem with a PHP script, in which I call the system function > (to call another processes). The call is : > > system("R --slave --vanilla < path/to/source/source.R"); > > if in this R file, I've got the lines: > pdf(file="/path/to/file/file.pdf") > commands > dev.off() > > the pdf file is perfectly created > > but if I change the lines to: > > png(file="/path/to/file/file.png"); > commands > dev.off() > > (or with the jpeg() function) > > the files are not created. any help? > > Thanks > > [[alternative HTML version deleted]] > > > > -- > > ___ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE read the posting guide! http://www.R-project.org/posting-guide.html > > > End of R-help Digest, Vol 40, Issue 21 > ** Juan Antonio Breña Moral. Advanced Marketing Ph.D. , URJC, Spain (Now) Industrial Organisation Engineering, ICAI, Spain. Technical Computer Programming Engineering, ICAI, Spain Web: http://www.juanantonio.info Mobile: +34 655970320 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Yahoo data download problem
I have some function to solve your problem. #Plot stock quote PSQ <- function(INSTRUMENT,FROM,TO,START){ #Procedure to download Stock Quote Information DATA <-yahoo.get.hist.quote( instrument = INSTRUMENT, destfile = paste(INSTRUMENT, ".csv", sep = ""), start=FROM, end=TO, quote = c("Close"), adjusted = TRUE, download = TRUE, origin = "1970-01-01", compression = "d"); #Conversion procedure to Time Series R Objetct; DATA.TS = ts(DATA,frequency = 365, start = c(START, 1)) plot(DATA.TS); return(DATA.TS); } #To compare COMPARE_QUOTES <- function(QUOTES,FROM,TO,START){ L = length(COMPANIES); par(mfrow=c(L,1)); for (i in 1:L){ PSQ(QUOTES[i],FROM,TO,START); } par(mfrow=c(1,1)); } COMPANIES <-c("GE","MMM","IBM"); COMPARE_QUOTES(COMPANIES,"1990-01-01","2006-06-16",1990); IBM <- PSQ("IBM","1990-01-01","2006-06-16",1990); > > Message: 1 > Date: Fri, 16 Jun 2006 12:10:53 +0200 > From: "Petr Pikal" <[EMAIL PROTECTED]> > Subject: Re: [R] Yahoo data download problem > To: SUMANTA BASAK <[EMAIL PROTECTED]>,R HELP > > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=US-ASCII > > Hi > > > On 16 Jun 2006 at 8:52, SUMANTA BASAK wrote: > > Date sent:Fri, 16 Jun 2006 08:52:22 +0100 (BST) > From: SUMANTA BASAK <[EMAIL PROTECTED]> > To: R HELP , > [EMAIL PROTECTED] > Subject: [R] Yahoo data download problem > >> Hi all R-Experts, >> >> I'm facing one problem in yahoo data downloading. I'm suing Windows >> XP, R 2.2.0, and i'm using yahoo.get.hist.quote function to download >> data. I need 500 companies of S&P index daily 'closing price' data for >> last ten years. My questions are: >> >> 1) I have all the ticker names of S&P 500 companies in a .csv format. >> I'm reading those names in R and they are coming as data.frame object. >> How can i change this to a vector? > > df<-data.frame(x=sample(letters,10)) > > as.vector(df$x) > [1] "g" "b" "p" "u" "r" "q" "j" "h" "o" "k" >> > > HTH > Petr > > >> >> 2) How can i get all companies data downloaded using a simple "for" >> loop? >> >> I'm using the following function for a single stock data. >> >> >> library(gdata) >> s<-yahoo.get.hist.quote(instrument = "mo", destfile = paste("mo", >> ".csv", sep = ""), start="1996-01-01", >> end="2006-06-16", quote = c("Close"), adjusted = >> TRUE, download = TRUE, origin = "1970-01-01", >> compression = "d") >> >> >> Thanks, >> Sumanta Basak. >> >> >> - >> >> >> [[alternative HTML version deleted]] >> >> __ >> R-help@stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! >> http://www.R-project.org/posting-guide.html > > Petr Pikal > [EMAIL PROTECTED] > Juan Antonio Breña Moral. Advanced Marketing Ph.D. , URJC, Spain (Now) Industrial Organisation Engineering, ICAI, Spain. Technical Computer Programming Engineering, ICAI, Spain Web: http://www.juanantonio.info Mobile: +34 655970320 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Rotate values on Y axis
Hi, I have been working through one of the examples on the FAQ about rotating the labels on the x axis, I need to do the same but for the y axis. I have managed to change some of the code, but I am still not getting there, there is still something wrong. My syntax is as follows: > par(mar = c(5, 7, 4, 2) + 0.1) > plot(1 : 8, yaxt = "n", ylab = "") > axis(2, labels = FALSE) > labels <- paste("Label", 1:8, sep = " ") > text(1:8, par("usr")[3] - 0.25, srt = 45, adj = 1, + labels = labels, xpd = TRUE) If anybody knows what is wrong then I would appreciate your help...been working on this for far too long already! Regards, Dan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Rotate numbers on the Y axis on a multiple Boxplot chart
Hello All, I am trying to format a box plot chart for a report so it matches other charts I have created in other software programs. My problem is that I need to rotate the values on the Y axis by 45 degrees, I have tried to use the srt parameter but with no luck? Does anybody have any suggestions? Regards, Daniel My syntax is as follows: boxplot(int~sortf,notch=TRUE,outline=FALSE,col="DarkSeaGreen4", ylab = "Length of stay in days",ylim=c(0, 100),xlab="Trust (see key)") __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] parallel computing
Dear R users, I have access to a Sun cluster with multiple processors , a lot of RAM and with RedHat installed. I want to take advantage of its power for a R routine very time consuming. Whick package do I have to use? I know there are snow,snowFT and others package.Which is the best for my purpose? Do someone have experiences with this? Thanck in advance. Moreno __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] is there a way to find the best ARIMA model
Using forecast package. http://www-personal.buseco.monash.edu.au/~hyndman/Rlibrary/forecast/ Best Regards. Message: 50 Date: Thu, 18 May 2006 18:50:15 -0400 From: "Wensui Liu" <[EMAIL PROTECTED]> Subject: To: Michael <[EMAIL PROTECTED]> Cc: R-help@stat.math.ethz.ch Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed what is your criterion of 'best arima'? there are more than 1 criterion for 'best' model. On 5/15/06, Michael <[EMAIL PROTECTED]> wrote: > I tried to find a function called "bestARIMA" but it did not show up... even > on google it does not show up often: > > I've only found the following link with "bestARIMA" in it: > > http://sirio.stat.unipd.it/files/ts02-03/tsR.pdf > > but where is the package and the function in R? > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > -- Juan Antonio Breña Moral. Advanced Marketing Phd, URJC, Spain (Now) Industrial Organisation Engineering, ICAI, Spain. Technical Computer Programming Engineering, ICAI, Spain Web: http://www.juanantonio.info Mobile: +34 655970320 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [Re: Running a likelihood ratio test for a logit model]
?glm and have a look at the components of the list returned by the object (i.e. glm.mymodel) of class glm (glm.mymodeld$null.deviance - glm.mymodeld$deviance) best, isaia Original Message Subject: [R] Running a likelihood ratio test for a logit model Date: Thu, 18 May 2006 02:20:54 -0500 From: Chris Bergstresser <[EMAIL PROTECTED]> To: r-help@stat.math.ethz.ch Hi all -- I have to calculate a likelihood ratio test for a logit model. I found logLik, but I need to calculate the log likelihood for the model without any predictors. How can I specify this in glm? If the full model is glm(y ~ x1), is the one without predictors (y ~ 0)? Or (y ~ 1)? Is there a more direct way of getting this? -- Chris -- ~~~ ~ Ennio D. Isaia ~ Dep. of Statistics & Applied Mathematics, University of Torino ~ Piazza Arbarello, 8 - 10122 Torino (Italy) ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83 ~~~ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [Re:] function to replace missing values with median value?]]
The following should work sz <- function(x) { ifelse(is.na(x) == F, x, median(x, na.rm=TRUE)) } best, isaia. Original Message Subject: [R] function to replace missing values with median value? Date: Wed, 3 May 2006 10:06:40 -0700 (PDT) From: r user <[EMAIL PROTECTED]> To: rhelp I have a data set with ~10 variables (i.e. columns). I wrote this little function to replace missing values with zero. “ sz <- function(x) { ifelse(is.na(x)==F,x,0) } “ Can anyone help with a function that replaces missing values with the median of the non-missing values? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- ~~~ ~ Ennio D. Isaia ~ Dep. of Statistics & Applied Mathematics, University of Torino ~ Piazza Arbarello, 8 - 10122 Torino (Italy) ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83 ~~~ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [Fwd: Re: simple if statement]
Try this way i <- 1 if (i==1) {years <- "Freshmen"} if (i==1) {years <- "Sophomores"} it should work! Brian Quinif wrote: > I am ashamed to be asking this question, but I couldn't find the > solution anywhere. Searching for "if" and "R" is not very > productive... > > I cannot get a simple if statement to work. > > I have data on college students. I want to make a string variable > that has the names of the years. That is, when the year variable i is > equal to 1, I want to have a variable called years equal to > "Freshmen". > > I tried this > years <- "Freshmen" if i==1 > years <- "Sophomores" if i==2 > > and so on, but I couldn't get it to work. How can I get this variable to > work? > > Thanks, > > BQ > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > -- ~~~ ~ Ennio D. Isaia ~ Dep. of Statistics & Applied Mathematics, University of Torino ~ Piazza Arbarello, 8 - 10122 Torino (Italy) ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83 ~~~ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] help with vectorizing a function
Dear r-helpers, I am developing a smoothing function that performs a casewise deletion of all the non-informative observations in a bivariate dataset following the Poisson - D'Avril algorythm. But I am now facing two problems: 1)Being based on loops, the function takes a lot of time before having done its work and even if I tried I was not able to vectorize it. 2) I cannot control the degree of smoothing. I have read the posting guide, the FAQ and have also RSiteSearched but without success. Can anybody help me? Here is an example of the procedure: (i have noticed also a different behaviour on different machines) ## x <- rnorm(1000, sd=15) y <- -x + rnorm(1000, sd=15) plot(x, y, ann=F, pch=16, xlim=c(-50,50), ylim=c(-50, 50), asp=1, col=2) abline(lm(y ~ x)) metamat<-c( 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0) matemot<-c( 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0) par(cex=.8, pch=15) for(j in seq(-46, 60, 7)){ for (i in -64:58){ points(i+rep(1:8, 8), rep(1:8, each=8)-j, col=metamat) Sys.sleep(0.1) points(i+rep(1:8, 8), rep(1:8, each=8)-j, col="white") Sys.sleep(0.1) points(i+rep(1:8, 8)+1, rep(1:8, each=8)-j, col=matemot) Sys.sleep(0.1) points(i+rep(1:8, 8)+1, rep(1:8, each=8)-j, col="white") } } # Thank you, Glucinio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Multinomial Logistic Regression (parameters distribution)
Dear R-Users, I applied the function multinom() to perform a multinomial logistic regression analysis on the following data: age class1 class2 class3 1 17.0 543 147 10 2 22.0 412 254 47 3 27.0 388 332 90 4 32.0 487 425146 5 37.0 412 380176 6 42.0 306 376228 7 47.0 225 352296 8 52.0 164 296375 9 57.0 146 211346 10 62.069 132240 11 67.0 138 190710 12 72.026 23197 where age is the predictor. I would need to obtain the distribution of the model parameters that should be a multinormal and simultaneous confidence interval for them. I would need also to calculate the simultaneous confidence intervals for the multinomial proportions. Could you please be so kind to suggest how to do and if there is already any function in R? thank you for your time Maurizio SERVIZIO VOICE: TELEFONA e INVIA SMS dal tuo computer a tariffe vantaggiose! Scopri come telefonare e videochiamare gratis da pc a pc. http://voice.repubblica.it __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] how to get ROC for SVM
> Message: 1 > Date: Mon, 20 Feb 2006 17:19:41 +0530 > From: "karthi keyan" <[EMAIL PROTECTED]> > Subject: [R] how to get ROC for SVM > To: r-help@stat.math.ethz.ch > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain > > Hi > How can i get ROC for svm during modelling in SVM. how to plot the > values > > thanks > > karthik Probably this will help: http://rocr.bioinf.mpi-sb.mpg.de/ Paolo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Hybrid Multidimensional Scaling
Hi all, Does anyone know if there's R code available for doing Hybrid Multidimensional Scaling (or Semi-Strong HMDS, e.g. Belbin 1991 J. Veg. Sci. 2:491-)? I've found only commercial software that does it. Thanks, Anni __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] question about binary data file and data.frame
Each data (edge,weight) is numerical data with type double (4 bytes) df<-file("d:/sim.data","rb") age[1]<-readBin(df,double()) weigt[1]<-readBin(df,double()) ... age[10]<-readBin(df,double()) weigt[10]<-readBin(df,double()) it is not asc file. === 2006-02-07 13:03:17 === >[EMAIL PROTECTED] wrote: >> I have a binary file with data sequence in the order > > What do you mean by 'binary file'? > >> [age,weight][age,weight] > > How are age and weight encoded in this 'binary file'? > >> I know the length of the data and I want to load it into a >> data.frame. of course a way to do this is to read age and weight >> seperately and then use cbin(age,weight) to combine them into a >> dataframe, but is there a better solution? >> > > Is it really an ASCII file? With age and weight separated by commas, >and then age-weight pairs separated by spaces? Are there really square >bracket pairs in there too? > > Or is it really a binary file, a series of 4 or 8-byte binary >representations of age and weight? > > Barry = = = = = = = = = = = = = = = = = = = = www.brook [EMAIL PROTECTED] 2006-02-07 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] question about binary data file and data.frame
I have a binary file with data sequence in the order [age,weight][age,weight] I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is there a better solution? Thanks in advance! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Classification of Imbalanced Data
Hi, I'm looking to perform a classification analysis on an imbalanced data set using random Forest and I'd like to reproduce the weighted random forest analysis proposed in the Chen, Liaw & Breiman paper "Using Random Forest to Learn Imbalanced Data"; can I use the R package randomForest to perform such analysis? What is the easiest way to accomplish this task? Thanks, Paolo Sonego __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] obtaining ROC curve from Nearest Shrunken Centroids (pamr)
Hello, I have binary labels from a nearest shrunken centroids prediction (package pamr). I need to obtain a ROC curve for this test. What is the easiest way to obtain one? Paolo Sonego __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] produce hours greater than 23
Hy all, I wish to use the date function to draw againt the lifetime of a motor. This lifetime is given to me in Hours (it can go over 5000 hours) I'm unable to find how to convert this lifetime value to something like %H:%M:%S because when R see 24H it says 1 day, i don't want that, i just want %H:%M:%S with a value of %H higher than 24... for example: i've got this value in hours: 345.05 H I wish that R gives me : "345:3:0" or "345:03:00" What R function could do it? I've search for as.Date strptime... but none of these seems to be able to put a value for %H greater than 23. i've browse the help and docs and found nothing (am i blind?). thks all guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] cox model test heterogeinity
I'm a young physician and i work on the breast cancer. I made a cox model and i want to do a test of heterogeneity. Do you know how i can do this with R. I'm sorry for this question wich seems to be easy for you. I read the manual and the help and i don't find it. Thanks for your help Bertrand Billemont __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] clustering method
Hello r-helpers I have a correlation matrix (either pearson or spearman) of 41 variables and i want to use it to construct a tree with agnes command (instead of using the distances). My problem is that at the height of the tree i see negative scaling also which is not desired. Is there any r-command that uses as a distance method the correlation estimates instead of distances (distances=dissimilarities, correlations=simmilarities) so that the height of the tree will be between 0 (zero) and 1 (one). Or simply, is there a way to transform the correlations in a proper way and to use the agnes command for example so that the height of the tree will be between 0 and 1?Thank you very much. _ http://domains.europlanet.gr Ôï üíïìÜ óáò óôï internet ìüíï ìå 10 Åõñþ. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] change read.table by scan
Hi all, Before the amount of data given has grown i was initially using read.table to load the values inside R. It was feeding my needs because i could tell read.table h=T, then use attach to access the values by columns names. Now it takes 20 seconds to load the data's and the first enhancement i could do is to win some time on the load of the data's... How could i use the scan function (which is faster) to build the data as if i've used read.table("file",h=T) then attach? /* the code i use actually */ tab<-read.table("blob/data.dat",h=T) attach(tab) /* is it possible to produce the same using scan? */ thks all for understanding my question. guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] column name of a table
hy all, I wish to switch in a part in my code that use "read.table" to "scan", actually i use this: tab<-scan("data.dat",what=integer(),skip=1) dim(tab)<-c(75,length(tab)/75) tab<-t(tab) It gives me a new tab with 75 columns, but i when i was using read.table with headers then attach i could use the columns names to access the data values, now how can i attach the columns names that are on the first line of the file data.dat? Any help would be great! thks all guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] about empirical sample size in partial correlations
Hello everyone I have estimated the partial correlations of a matrix (n=160, vars=7) with command pcor.shrink (library corpcor) and then i want to estimate their respective confidence intervals. So i have tried to use the command pcor.confint(pcor,kappa,alpha) from library "GeneNT". My problem is that i don't know how to estimate kappa (empirical sample size). Is there any command with wich i can estimate kappa or is there any other command for estimating confidence intervals for partial correlations without using the kappa parameter? Thank you _ http://www.mailbox.gr ÁðïêôÞóôå äùñåÜí ôï ìïíáäéêü óáò e-mail. http://www.superweb.gr ÏéêïíïìéêÜ êáé áîéüðéóôá ðáêÝôá web hosting ìå áóöáëÝò Åëëçíéêü controlpanel http://www.domains.gr Ôï üíïìÜ óáò óôï internet ìüíï ìå 10 Åõñþ. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] about empirical sample size
Hello everyone I have a case in which i need some help. I have evaluated the partial correlations of a data.frame (n=160, variables=7) using the command pcor.shrink (library "corpcor") and then i want to evaluate the confidence intervals of these estimations by using the command pcor.confint (library "GeneNT"). The structure of this command is pcor.confint(x,kappa,alpha) where x is the data.frame of the partial correlations (already evaluated), alpha is the sig. level (0.05 for example) and kappa is the empirical sample size. My problem is that i don't know how to estimate kappa (the empirical sample size). So, i have used as kappa=160 (n) which i think is not correct. Does anyone knows how can i estimate kappa in my case (where n=160 and variables=7) and in generall? Kind regards Vangelis _ http://www.mailbox.gr ÁðïêôÞóôå äùñåÜí ôï ìïíáäéêü óáò e-mail. http://www.superweb.gr ÏéêïíïìéêÜ êáé áîéüðéóôá ðáêÝôá web hosting ìå áóöáëÝò Åëëçíéêü controlpanel http://www.domains.gr Ôï üíïìÜ óáò óôï internet ìüíï ìå 10 Åõñþ. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] truncate/overwrite a data frame
hi all, I've got a data frame, this data frame have 76 columns and 22600 rows. The data inside can be redundant because the data can be captured simultaneously and overlap each other. My aim is to supress these overlaps I've test some solutions to do that but they all give a big cpu load and eat all of the memory then swap a lot, then killall R because it don't end. actually i've tested this (it don't works but seems to be correct for me...): My first try (i was trying to overwrite the table on the overlap): tab[(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])):length(TotalFillTimeHours),1:length(tab)]<-tab[(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])):length(TotalFillTimeHours),1:length(tab)]; My second idea was to make 2 tab without the overlap, then put them together: tab_tmp<-tab[1:(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])),1:length(tab)]; tab_tmp1<-tab[(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])):length(TotalFillTimeHours),1:length(tab)]; tab<-as.data.frame(c(tab_tmp, tab_tmp1)); attach(tab); In these 2 case it didn't succeed, by the lack of comprehension that i have in R programming ...(it isn't R fault :). thks all guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] concatenate data frame
hi all Here is a small part of my code: tab_tmp<-tab[1:(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])),length(tab)]; tab_tmp1<-tab[(no[off_set[i-1]+1]+(no[off_set[i]+1]-no[off_set[i-1]+1])):length(TotalFillTimeHours),length(tab)]; tab<-c(tab_tmp,tab_tmp1); attach(tab); Here is the output: Error in attach(tab) : attach only works for lists and data frames Execution halted How do i concatenate them in order to keep the data frame structure? thks for your help guillaume __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] about sorting table
hi all, I load a table with headers that enable me to acces it by the column names: tab<-read.table("blob/data.dat",h=T) attach(tab) everythings are OK, but i try to sort this table against one of his column like this: tab<-tab[order(tab$IndexUI),]; It is still ok, the table is sorted, if i type "tab" i see a sorted table. but, when i call the column by their names, it appears that the column isn't sorted... I believe that, is there a solution to attach column names another time, to reflect the effect of sorting this table? thks all for your answers guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] font size in legend
Hy all I use barplot to draw frequencies by dates. On the x axis it shows only 1 date for 2 bars, i've understand why, because R cant put so much date on the same axis, it will get out of the graph. that's why i tought about reducing the size of the font used to stamp the x axis. anyone knows the right way? i've tryed par(cin) and barplot(cin=3) but it says i cannot do it at this level... thks you all. guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Dear all, just a little problem report for R 2.2.0 on OpenSuse 10.0-64. Gcc version is 4.0.2 Installing fortran packages runs into: 'cc1' command not found. I apparently got away with: sudo ln -s /usr/bin/cc /usr/bin/cc1 which causes other warnings but the packages seem to function well. Obviously cc1 does no longer exist in gcc 4.0.2. Stefan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] selection of missing data
Hi i'm a french medical student, i have some data that i import from excel. My colomn of the datafram are the localisations of metastasis. If there is a metatsasis there is the symbol "_". i want to exclude the row without metastasis wich represent the NA data. so, i wrote this mela is the data fram mela1=ifelse(mela[,c(11:12,14:21,23,24)]=="_",1,0) # selection of the colomn of metastasis localisation mela4=subset(mela3,Skin ==0 & s.c == 0 & Mucosa ==0 & Soft.ti ==0 & Ln.peri==0 & Ln.med==0 & Ln.abdo==0 & Lung==0 & Liver==0 & Other.Visc==0 & Bone==0 & Marrow==0 & Brain==0 & Other==0) ## selection of the row with no metastasis localisation nrow(mela4) but i dont now if it is possible to make the same thin as ifelse(mela3,Skin & s.c== 0, 0,NA) with more than colomn and after to exclude of my data the Na with na.omit. The last question is how can i omit only the row which are NA value for the colomn metastasis c(11:12,14:21,23,24)) Thank you for your help Bertrand billemont [[alternative text/enriched version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] reading big data frame
hy all, I'm under linux, I have now a big file (45 méga bytes), this file is a line of header defining the names of the columns, the rows are only integers and there is 75 columns (and 239096 rows included the header). Before working with this big file i was working with another one (1.7 méga bytes) , loading it with read.table("data.dat",h=T) (i've tested too with scan("data.dat",what="integer",skip=1)), there where no problems, it where taken approx 1 sec to load it into R. but now with the big file R it seems that R stay stuck (i've wait more than 5 minutes and R don't come back from the read.table function, i've tested with scan("data.dat",what="integer",skip=1)). I say it stay stuck because i've spy R with the linux "top" command line, and R begin to take all my memory (no prob with that) and 100% of my cpu (no prob too), then after 3 or 4 minutes it take only 3% of cpu and the memory allocated to R is average 90%, but R never come back from these functions (or i haven't wait enough, and i need to give a result as speed as i can unfortunatly). I've divided the size of the file by 2 , then it works (i've only tested with scan) but it is too slow... Are there some solutions to load it in one piece? Or have i to truncate the file and access it piece by piece? thks all guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] hist of dates
Hi all I wish to draw an histogram... with dates but the following append, i don't know where is the problem, help(hist.Date) works and i don't see any usefull information on what i'm doing wrong... > hist.Date(dt_cycles) Error: couldn't find function "hist.Date" > hist.date(dt_cycles) Error: couldn't find function "hist.date" > cycles [1] 7 1 2 5 14 5 > dt_cycles dates_releves cycles 12005-07-01 7 22005-07-04 1 32005-07-06 2 42005-07-11 5 52005-07-25 14 62005-07-27 5 > dates_releves<-as.Date(dates_releves) > hist(dates_releves,cycles) Error in hist.Date(dates_releves, cycles) : invalid specification of 'breaks' > hist(dates_releves~cycles) Error in hist.default(dates_releves ~ cycles) : 'x' must be numeric > Any ideas would be great... thks guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] drawing against a date
hy all I wish to draw a graph against a date, I have a set of date like this DD/MM/, corresponding to it a set of integer , i wish to draw on x side the dates (the space between the dates have to be constant, not based on the time between 2 dates but on the number of dates) and on y side the integers. Do i have to make a tricky function under R ? I've search the help for graphical functions but my poor english seems to make me missing the solution... thks for your help guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] axis of plot
hy, I need to have the 0 on the bottom left corner of the graph being joined , not with this little hole between x axis and y axis... I've saw this question with the answer one time but i'm unable to find it again.. thks. guillaume __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] default height width of graphs
hy all, When i plot under R it generates a 440x440px image, is it possible to modify and increase this ? thks all guillaume. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Installation problem on SGI IRIX6.5
Hi, all, I'm a newbie to R. I came across a problem when I tried to install R on an SGI machine which is running IRIX64 6.5. I have successfully run configure, but when I tried to run "make"(or "gmake"), errors came out. Following is the error message. Does someone has experiences in the R's installation on IRIX ? Any hints will be greatly appreciated ! Thanks in advance! Error Message: cc -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre -I. -I../../src/include -I../../src/include -I/user_data2/jfxiao/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c character.c -o character.o cc-1185 cc: WARNING File = character.c, Line = 714 An enumerated type is mixed with another type. warn = warn | !utf8strIsASCII(CHAR(STRING_ELT(CAR(args), i))); ^ cc-1552 cc: WARNING File = character.c, Line = 698 The variable "uclass" is set but never used. int i, len, minlen, uclass; ^ cc-1020 cc: ERROR File = character.c, Line = 1300 The identifier "wctrans_t" is undefined. wctrans_t tr = wctrans(ul ? "toupper" : "tolower"); ^ cc-1185 cc: WARNING File = character.c, Line = 1733 An enumerated type is mixed with another type. Rboolean warn = !utf8strIsASCII(CHAR(STRING_ELT(pat, 0))); ^ cc-1185 cc: WARNING File = character.c, Line = 1926 An enumerated type is mixed with another type. useRaw = strcmp(CHAR(STRING_ELT(stype, 0)), "integer"); ^ 1 error detected in the compilation of "character.c". gmake[3]: *** [character.o] Error 2 gmake[3]: Leaving directory `/user_data2/jfxiao/local/source/R/R-2.1.1/src/main' gmake[2]: *** [R] Error 2 gmake[2]: Leaving directory `/user_data2/jfxiao/local/source/R/R-2.1.1/src/main' gmake[1]: *** [R] Error 1 gmake[1]: Leaving directory `/user_data2/jfxiao/local/source/R/R-2.1.1/src' gmake: *** [R] Error 1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] multiple scale
Hi all i need to put on one graph 2 functions who's x axis is the same and y not. I mean on horizontal the time, and on vertical left: pressure, on vertical right: rpm of a motor, is R able to do that? i've found this that i could adapt maybe (i don't need time series really?) :/ : (http://tolstoy.newcastle.edu.au/R/help/04/03/1456.html) ## ## Description: A simple function which plots two time series on one plot where ## the series can have different value intervals over the same time interval. ## Usage: ts.plot.2Axis(xleft, xright) ## Arguments: xleft is the time series for the left vertical axis and xright ## is for the right axis. xleft and xright are defined as time series with ## the 'ts' function in package ts. ## ts.plot function must be available, do library(ts) to ensure this if ## necessary. ## In addition the usual 'ts.plot' and 'plot' parameters can be set ## directly (mar, main, xlab, ylab, lwd) or through gpars as in ts.plot. ## Also parameter digits is the preferred number of decimal digits on right ## axis and ticks is the preferred number of tick marks on right axis. ## Details: The time series for the right vertical axis is scaled with a simple ## rule of thumb scaling. ## The ts.plot function is used to plot the series. ## Value: None. ## Note: When scaling is not acceptable try switching the series parameters. ## If a ylabel is to be set it is here only possible for the left axis. ## See also: 'ts.plot', 'ts', 'legend'. ## Author and date: Hauksson, Bjorn Arnar. March 2004. ## Example: ## First paste this function into the R console or use 'source'. #library(ts) #data(UKLungDeaths) #x <- ldeaths #y <- fdeaths/mdeaths #ts.plot.2Axis(x, y) #legTxt <- c("UK lung deaths", "UK female/male deaths (rhs)") #legend(1976.5, 3950, legTxt, lty=c(1:2), col=c(1:2), lwd=2, bty="n") ## ts.plot.2Axis <- function(xleft, xright, digits=1, ticks=5, mar=(c(4,4,4,4)+0.1), main="", xlab="", ylab="", lwd=2, gpars=list()) { # Settings for other parameters than those in the function parameter list par(mar=mar) # Margins k <- ncol(as.matrix(xleft)) # Number of time series on left vertical scale lty <- c(1:(k+1)) # Line types col <- c(1:(k+1)) # Line colors # Scale time series on right vertical axis scale <- (max(xleft)-min(xleft))/(max(xright)-min(xright)) xright2 <- xright*scale meanScale <- mean(xleft) - mean(xright2) xright2 <- xright2 + meanScale # Plot the series ts.plot(xleft, xright2, lty=lty, col=col, main=main, ylab=ylab, xlab=xlab, lwd=lwd, gpars=gpars) # Add the right vertical axis labels lab <- seq(round(min(xright), digits), round(max(xright), digits), length=ticks) labAt <- seq(min(xright2), max(xright2), length=ticks) axis(side=4, labels=lab, at=labAt) } are there a better way to plot what i want? thks. guillaume. // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] plotting 3 functions on same graph
hi all, I wish to draw on the same graphic device 3 functions. But i don't want them to be on different graph, i want to compare them on the same I don't need mfrow or mfcol, I need something else... 1 graph on 1 device inside this graph 3 ploted function. I saw something unsing data.frame, but i think it's overkill, and something less complicated must exist, if not why? why not plot(func1,func2,func3) ?? thks. // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
hi all, I wish to draw on the same graphic device 3 functions. But i don't want them to be on different graph, i want to compare them on the same I don't need mfrow or mfcol, I need something else... 1 graph on 1 device inside this graph 3 ploted function. I saw something unsing data.frame, but i think it's overkill, and something less complicated must exist, if not why? why not plot(func1,func2,func3) ?? thks. // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] thks all
hi all I wish to thanks every body on the R mailing list for answering very fast, directly in my mail box ;). I've finish my work with R and i can say that it is very difficult at the beginning, and when you succeed you are stopped by a stack overflow when you call your nice recursive function (which was working with a tab of 100 element) with a tab of 900 elements, but R just do what you tell him and these errors have push me to optimize , i succeed to do it with R ! and you've helped me that way :) so THKS all R-users! guillaume. // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] sort a table
hi all, I need to sort a table like this one: n tmp s 1 215 0 2 654 1 3 213 0 4 569 1 5 954 1 6 562 1 7 252 0 8 555 0 9 988 1 I want to organize it with tmp increasing to produce the same tab but ordered by tmp I think it is simple but just show me how good you are in R ... thks guillaume. // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] calling R from C or C++
hi all You should look into the "tests" directory (download the source package extract it and you'll have the tests directory) there are some exemples on how to embedded R into C. I've got the same trouble, here nobody want to do that, and i don't know why... -- Initial Header ------- >From : [EMAIL PROTECTED] To : Bahoo <[EMAIL PROTECTED]> Cc : r-help@stat.math.ethz.ch Date : Sun, 24 Jul 2005 10:27:54 -0500 Subject : Re: [R] calling R from C or C++ On 23 July 2005 at 20:18, Bahoo wrote: | > Hi, | > | > I have C/C++ code from which I wish I could call R | > to | > do something useful. | | By calling I mean linking with the R shared library, | instead of R BATCH. | | In particular, I want to use regression functions such | as ridge and locfit. | | > | > I saw a 2003 message by Thomas saying that "You can | > compile R as a shared library, which allows you to | > construct and evaluate R expressions from C." Any | > more information would be helpful. I am looking for | > some documentation that has a more step by step like | > instructions. Anyone who has experience, please | > point | > me to some resources. | > | > ps. There is a document on CRAN named "Writing R | > extensions" which seems relevant, but it was too | > difficult for me to understand. Just get the Magic Wand from the Harry Potter books; that way you get the functionality for free without having to read those pesky and difficult documents we provide to explain how to do the other way -- when your Magic Wand is broken. Dirk, who still wants chocolate to grow on trees, preferably in his backyard | R-help@stat.math.ethz.ch mailing list | https://stat.ethz.ch/mailman/listinfo/r-help | PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ^ (hint !) -- Statistics: The (futile) attempt to offer certainty about uncertainty. -- Roger Koenker, 'Dictionary of Received Ideas of Statistics' __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] multiplicate 2 functions
Thks for your answer, here is an exemple of what i do with the errors in french... > tmp [1] 200 150 245 125 134 345 320 450 678 > beta18 Erreur : Objet "beta18" not found //NORMAL just to show it > eta [1] 500 > func1<-function(beta18) dweibull(tmp[1],beta18,eta) > func1<-func1(beta18) * function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans dweibull(tmp[1], beta18, eta) : Objet "beta18" not found //I don't want to evaluate weibull immediatly just want to initialize the function then integrate on beta18,i have to make the multiplication of weibull at each time pointed by tmp then integrate it to obtain a norm. > func1<-func1() * function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans dweibull(tmp[1], beta18, eta) : l'argument "beta18" est manquant, avec aucune valeur par défaut > func1<-func1 * function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans func1 * function(beta18) dweibull(tmp[2], beta18, eta) : argument non numérique pour un opérateur binaire > func1<-func1 & function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans func1 & function(beta18) dweibull(tmp[2], beta18, eta) : ces opérations ne sont possibles que pour des types numériques ou logiques > func1<-func1(beta18) & function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans dweibull(tmp[1], beta18, eta) : Objet "beta18" non trouvé I hope you understand what i want to do. thks guillaume ------ Initial Header --- >From : Uwe Ligges <[EMAIL PROTECTED]> To : "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Cc : r-help Date : Fri, 22 Jul 2005 12:51:47 +0200 Subject : Re: [R] Generate a function [EMAIL PROTECTED] wrote: > hi all, > > I need to generate a function inside a loop: > > tmp is an array Well, a 1-d array, or better say a vector of length 10, given the code below is correct. > for (i in 1:10) > { > func<- func * function(beta1) dweibull(tmp[i],beta1,eta) > } > > because then i need to integrate this function on beta. > > I could have written this : > > func<-function(beta1) prod(dweibull(tmp,beta1,eta)) (with eta and beta1 set) > > but it is unplottable and no integrable... i could make it a bit different but if i do that ( prod(tmp)=~Inf ) i'm stuck. > > > I've looked in R-poetry and i didn't find anything usefull. > > I think i have a problem with how i tell R my function is, R seems to think it is a function like programmers do but not a f(x) function. Please specify a reproducible example (as the posting guide asks to do), that means including the values for tmp, beta1 and eta. Then we might be able to explain where you have your problems. Uwe Ligges > Thks > guillaume > > > // Webmail Oreka : http://www.oreka.com > > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html // Webmail Oreka : http://www.oreka.com // Webmail Oreka : http://www.oreka.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html