[R] help
Dear all: I have this: A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3 And I want this A1 E1 B1 E1 C1 E1 D1 E1 A2 E2 B2 E2 C2 E2 D2 E2 A3 E3 B3 E3 C3 E3 D3 E3 Example: m<- matrix(1:15,nrow=3,byrow=T) m v<- unlist(list(t(m[,1:4]))) u<- rep(c(5,10,15),c(4,4,4)) data.frame(v,u) This is the result I want but I would like to learn a simpler way to do it. Any clue? Thanks j. silva [[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
[R] Help
Hi, Please, can you tell if there are any package or R code for STAR models estimation and test misspecification. Thanks in advance Best regards AJMI Noomen PHD Student TUNISIA __ 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
Please, is there any R-list about survival package ? Thanks Mauricio __ 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
Dear R members, Sorry for this question. I have a dataframe (please see the example) and i should do the following transformation: DF abc d e f g h i n 14 24 rcvfAG5 2 1 0 2 1 58 42 grde AC2 5 0 5 1 0 I should transforme my DF like : abcd ef g h in 14 24 rcvf A G0 0 G GA G G G G G A A 58 42 grdeA CC C 0 0 A A0 0A C A A i.e: when DF[i,j]==5 => DF[i,j] <- 0 0 When DF[i,j] == k (!=0) i should look to d column to do the transormation DF is 20 * 1 so i cant use loops. Thanks for your help, Claire [[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] help
Dear helpeRs, I seem to be a little bit confused on the result I am getting from the few codes below: > u=v=seq(0,1,length=30) > u [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. > v [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. > f=function(x,y){cp=max(x+y-1,0)} > z=outer(u,v,f) z is a 30x30 matrix which is fine, but why all its entries are equal to 1? for example, the maximum between u[22]+v[22]-1 and 0 is not 1?? I don't really know where I went wrong! thanks, Dominique ______ 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 ...
Hi there, When I run the following, why does it give a error like that? res2<-array(0,c(5,4,12488,1000)) Error: cannot allocate vector of size 1951250 Kb Thank you for helping me. Fay __ 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
Hello! I am a R user. recently,I am using Bayesian Network to inference posterior.but,I don't know how to input prior probability and inference posterior.I tried "prob" function,but fail.Can you help me? Thanks! ChuanXiang Ma [[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
[R] help
0.27 2.25 7113 0.28 0.13 0.18 2.25 7213 0.12 0.00 0.27 2.30 7313 0.13 0.00 0.29 2.33 7413 0.18 0.25 0.42 2.33 7523 0.16 0.06 0.26 2.33 7613 0.17 0.11 0.40 2.36 7713 0.13 0.07 0.31 2.38 7813 0.12 0.08 0.29 2.42 7913 0.10 0.10 0.26 2.60 8023 0.12 0.08 0.23 2.86 This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and or privileged information. Please contact the sender immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed. [[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] help
913 0.12 0.00 0.27 2.25 7013 0.12 0.08 0.27 2.25 7113 0.28 0.13 0.18 2.25 7213 0.12 0.00 0.27 2.30 7313 0.13 0.00 0.29 2.33 7413 0.18 0.25 0.42 2.33 7523 0.16 0.06 0.26 2.33 7613 0.17 0.11 0.40 2.36 7713 0.13 0.07 0.31 2.38 7813 0.12 0.08 0.29 2.42 7913 0.10 0.10 0.26 2.60 8023 0.12 0.08 0.23 2.86 This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and or privileged information. Please contact the sender immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed. This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and or privileged information. Please contact the sender immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed. [[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] Help
Hello, I am a new user of R statistical project. So, I have a matrix (4 columns and 330 rows) and I would like to have PCA (Principal Component Analysis). Besides, I would like to draw every 30 rows from 330 with a different colour but I dont know how. Could you help me by showing how can I draw every 30 rows with a different colour? Thank you very much Selim - Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. Cliquez ici. [[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] help
I am a teaching asistant at Ankara University. I try to analize ABD stock market returns.I want to compare coefficients of variation. But some of means are positive, some of means are negative. In this instance , how can compare coefficients of variation? Could you help me,please? Thanks... Sincerely... - Get your email and more, right on the new Yahoo.com [[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] help
hi, experts i do additive models analysis by mgcv. i want to extract every smoothing componets from the gam object. how can i do ? Thanks! -- Sincerely yours, Liu, jcheng Department of Biomedical Engineering, School of Medicine, Tsinghua University, Beijing, 100084, China. __ 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
consider p as random effect with 5 levels, what is difference between these two models? > p5.random.p <- lmer(Y ~p+(1|p),data=p5,family=binomial,control=list(usePQL=FALSE,msV=1)) > p5.random.p1 <- lmer(Y ~1+(1|p),data=p5,family=binomial,control=list(usePQL=FALSE,msV=1)) thanks, Aimin Yan ______ 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
Hi R-Users, I apologize if it is too simple question for all. I have a multivariate dataset having 7 variables as independent and 1 dependent variable. 248 data points are there. I want to do out sample forecast first considering 156 points. So I'll have to start from 157th point and calculate the 157th y_hat value. In this way it will go to 248th data point. Can any one tell me how I can do with for loop. Thanks a lot in advance. Thanks & Regards, SUMANTA BASAK. --- This e-mail may contain confidential and/or privileged infor...{{dropped}} ______ 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
Hi, I am trying to runn a age-period-cohort model, but here is what I am having problem with, hope you can help me! This is what I am trying to do: sumzero_a<-((A-min(A))/5+1) - mean((A-min(A))/5+1) where A is my age variable (numeric, the mid-point of a five-year age group), but I got the following error: Error in min(..., na.rm = na.rm) : invalid 'mode' of argument I am pretty sure I have the variable "A" in my data, can you see why this happens? Thanks. Yanyan == Yanyan Gong, MSc Senior Research Associate Ontario Cervical Screening Program Cancer Care Ontario 620 University Ave, 11th Floor Toronto ON M5G 2L7 (416) 971-9800, ext 3304 [EMAIL PROTECTED] == This e-mail message (and any attachments) may contain confid...{{dropped}} __ 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
Hi, I was trying to calculate an age adjusted rate for which we have the formula as sum(weight*rate)/sum(weight). I am using the framingham dataset called fram here.I cant figure out how I could change the logical statement I have for the standard dataset (in red) to calculate weight and calculating the wevents and atrisk(in red) Below is my code: attach(fram) dset1<-cbind(AGE,BMI,DEATH) BMIGRP1<-cut(BMI,breaks=c(14,20,25,57),right=TRUE) levels(BMIGRP1) BMIGRP<-as.numeric(BMIGRP1) AGEGRP<-floor(AGE/10)-2 dset<-cbind(AGEGRP,BMIGRP,DEATH) std<-cbind(AGEGRP) maxage<-max(dset[,1]) minage<-min(dset[,1]) maxcls<-max(dset[,2], na.rm=T) mincls<-min(dset[,2],na.rm=T) nage<-maxage-minage+1 nclass<-maxcls-mincls+1 nsub<-nrow(dset) weight <- matrix(0,nage,1) for ( i in minage:maxage ) weight[i-minage+1,1] = sum(std=i) atrisk = matrix(0,nclass,nage) wevents = matrix(0,nclass,nage) for( i in minage : maxage) for( j in mincls : maxcls) atrisk[j-mincls+1,i-minage+1] = sum((dset[,1]=i)& (dset[,2]=j)) wevents[j-mincls+1,i-minage+1]= sum((dset[,1]=i)& (dset[,2]=j)&(dset[,3]=1)) #vtit = char(t(mincls:maxcls),5,0) // {Total}; #htit = {'at risk' 'events' 'rate/1000'}; atrisk2 = atrisk // atrisk[+,1:nage]; event2 = wevents // wevents[+,1:nage]; atrisk3 = choose(atrisk2=0,1,atrisk2); rate = event2/atrisk3; this was done using sas macro. Thanks so much! - [[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
[R] help
Dear Sir, Iam a French Student. Iam a new user of the « R » Software. I dont success to import data from Excel spreadsheet either using the function (read.table) and the function (Rodbc). In addition, I dont understand very well the help of the R Software. Could you please help me and give a simple numerical example using this procedure : read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", row.names, col.names, as.is = FALSE, na.strings = "NA", colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = "#", allowEscapes = FALSE, flush = FALSE) read.csv(file, header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, ...) read.csv2(file, header = TRUE, sep = ";", quote="\"", dec=",", fill = TRUE, ...) read.delim(file, header = TRUE, sep = "\t", quote="\"", dec=".", fill = TRUE, ...) read.delim2(file, header = TRUE, sep = "\t", quote="\"", dec=",", fill = TRUE, ...) This is my e-mail: [EMAIL PROTECTED] Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn) [[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
[R] help
Dear Sir, Iam a frensh student and iam a new user of the R software. After using the command (x<-read.delim(clipboard) to read a spreadsheet of Excel, I want to run the bds test and calculate the Lyapunov exponent. I have charged the R software by the packages tseries and tseriesChaos. when i run bds.test(x,m=2) Unfortunately the R software displays error in as.vector(x,mode= double) : the object (list) can not be automatically converted on double so what shall I do to run this two tests(lyapunov and bds)? And what is my mistake? I thank you in advance and Iam waiting forward your e-mail This si my e-mail: [EMAIL PROTECTED] Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn) [[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
[R] help!
I am learning to use R. What is the structure of the syntax for specifying a subset of data in fitting GLMMs? wilford __ 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!!
Hello, I am a Second year PhD student in Dept of Management and Organization from NUS Business School, Singapore. Presently I am doing a multilevel analysis for a small research project with my supervisor. While surfing the web, I found your website on multilevel analysis. These are very useful for the understanding of the concept to me. I was also trying to learn more by completing the lab exercises. For doing that I have installed R 1.6.2 software (and also R1.9.1) from the web. Actually, I need to calculate inter member agreement (rwg) and inter member reliability (ICC). I was told that the R software developed by you can help me in this regard. But at the same time I am not able to upload multilevel package from the library by using the following command. > library(multilevel) It says the package doesn't exist. I really don't know how to proceed further. As I want to calculate Rwg and ICC. I will be very thankful to you if you can help me in this regard. Thanking you Best regards, Sankalp [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] help
__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] help!!!
Dear R users, Would need some help. I will compare some results in a dotplot. The picture is very dark(grey) in the background, could I get it ligther? R-code dotplot(LINES~VAL, groups=QQ,key=simpleKey(levels(QQ1),space="top"),xlab="Values",main="Tail-Measure" ) (where LINES,VAL, QQ is vectors) -- This e-mail and any attachment may be confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and then delete this e-mail and any attachment without retaining copies or disclosing the contents thereof to any other person. Thank you. -- [[alternative HTML version deleted]] __ [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
[R] Help
Hi, I have a data set (data frame) approx. 50 rows * 600 columns. The columns are separated by commas. I would like to know how to remove those commas between the columns. What should I do to remove those commas? Secondly, if I want only to use part of the (data frame), say (50 rows * 300 columns) instead of (50 rows * 600 columns), what should I do? Thanks, Stephen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help
Hi, there, I have a question about multinom rountine. The response is a matrix, and the predicator is a data frame called dat. I would like multinom to get response and data from within this function test instead of from R Console session. - test <- function() { library(nnet) response <- diag(1,3) dat <- as.data.frame(matrix(round(rnorm(6)),3,2)) fit <- summary(multinom(response ~ ., data=dat)) coefficients <- fit$coefficients return(coefficients) } -- The response and dat are two different data sets, and one does not include another. But it seems multinom automatically get data and response from R Console environment, not the function test itself. So when I run the above function (assume that in R console we don't have objects response and dat), it gives error: cannot find response and dat. How can I let multinom get the data for the formula from within the function test without assigning response and dat into the R console environment. Thanks very much. Jun Han [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Help!!
Dear R-ers: I'm sorry to disturb you, I want just ask how to work with a sum? To be more exact I want to work with the function f(x)= sum_1^{n}K(x-x_i/h), K is a kernel or any other function I have a data set (x_i) and I want to compute x for each x or plot f(x). Thank you for your hulp __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Help!!
Dear R ers, if some can tel me how I can generate a sample from a given density. I have a complex 2D density function en I want to genearte a sample from it? Any package? Thank you Remon ,Utrecht _ Tired of spam? Get advanced junk mail protection with MSN 8. __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help
Hi, help.I would like to plot the mean and standard deviation against a factor in the xaxis- in other words I want an errorplot. I also want to put the standard deviation like a "T" on top of a barplot. How can do this in R Bragadeesh __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help
hi, I would like to plot error bar graph in R . Can I also change the the error bar graph to mean and Stdev instead of std error of mean. Also can we put a error bar on top of a bar plot like a "T" graph. Bragadeesh __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Help
Mac version for 8.6 cannot run R. Click on icon shows message that "cannot be opened because carbon lib cannot be found"; what do I do? J. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Help
hi my name is Tomer,im using R version 1.4 i've encontered a couple of problems with my my R programing. 1. i cant understand what is the whights in the nnet$wts command(which weight fit to the nodes). 2.my OS is Windows XP , i want to operate R from the command line and i want it to operate a file automaticly(the commands written in a text file) ,is it possible?( i know that in unix it is),How can i do it. thanks in advance. Tomer __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Help
Dear all, I have the problem, please, help me. I tried to import the dataset from the SPSS into the R. It is the panel (survey). The importing of the data show that my variables are read as afactor in R. But I need the variable "income" as a numeric one. I tried to use the following command: for(i in c("AGE99","AGE00","I99PTOT","I00PTOT","I99PTOTN","I00PTOTN","I99PTOTG","I00PTOTG")) + {df[[i]]<-as.numeric(df[[i]])} and then I get the error message. Error in "[[<-.data.frame"(*tmp*, i, value = as.numeric(df[[i]])) : replacement has 1 rows, data has 6335 What can I do? Could you please help me. I need it for my work. Dear all, I have the problem, please, help me. I tried to import the dataset from the SPSS into the R. It is the panel (survey). The importing of the data show that my variables are read as afactor in R. But I need the variable "income" as a numeric one. I tried to use the following command: for(i in c("AGE99","AGE00","I99PTOT","I00PTOT","I99PTOTN","I00PTOTN","I99PTOTG","I00PTOTG")) + {df[[i]]<-as.numeric(df[[i]])} and then I get the error message. Error in "[[<-.data.frame"(*tmp*, i, value = as.numeric(df[[i]])) : replacement has 1 rows, data has 6335 What can I do? Could you please help me. I need it for my work. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help
Hello, I am a new member, and I need your help. For my work (thesis), I use the package rpart to construct trees. But, to continu my studies, I need to calcule the 'variable importance'. But, I don't find a program to do this in the implementation of R. Is there someone who know if there exist a program which calculate the 'variable importance', notion defined by Breiman and al. in CART ? If this program exists, could you tell me where I can find it, to use it? Thanks a lot, and sorry for my english. Christine Tuleau __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] help
I want to extract the first non-zero digit of any vector, as for example from a<-runif(100,0,1). Tried it using grep (...) but didn´t work. Any help is very much appreciated. Thanks, Manica -- visite http://ipimar-iniap.ipimar.pt/neomav/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Help
To whom it may concern: Is there a function that we can use to easily obtain the rank of a matrix in R? Thank you very much. Jason Parcon - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R-help,
R-help, I usually call lapply to plot some dat frames structures.Something like this: par(mfrow=c(4,3),mar=c(2, 4, 2, 1) + 0.1) lapply(my.list , function(x) { plot(colnames(x) , apply(x,2,mean), type="o", pch = 16, ylab = "Index" , xlab = "") } ) But it is difficult for me to put a title on every plot according to the list names. I guess the re other ways to do it but the structure above is so handy to me that I want to stick to it. Any suggestions? I run on Windows XP machine > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor1.0 year 2005 month04 day 18 language R 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
Re: [R] help
It is really hard to read your message. Anyway, I guess you are looking for ?reshape Uwe Ligges jose silva wrote: Dear all: I have this: A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3 And I want this A1 E1 B1 E1 C1 E1 D1 E1 A2 E2 B2 E2 C2 E2 D2 E2 A3 E3 B3 E3 C3 E3 D3 E3 Example: m<- matrix(1:15,nrow=3,byrow=T) m v<- unlist(list(t(m[,1:4]))) u<- rep(c(5,10,15),c(4,4,4)) data.frame(v,u) This is the result I want but I would like to learn a simpler way to do it. Any clue? Thanks j. silva [[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 ______ 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] R-help
Background: OS: Linux Mandrake 10.1 release: R 2.0.0 editor: GNU Emacs 21.3.2 front-end: ESS 5.2.3 - Colleagues Is there a function in R that is an equivalent of zoom in matlab? This is very useful for being able to magnify details in a plot. I have searched the help for "zoom", "interactive zooming", and "magnify". The R search engine (reached from help.start() ) keywords by topic entry for dynamic graphics seems to have no content, unless I made a mistake. Here is the matlab function description: --- zoom Zoom in and out on a 2-D plot Syntax zoom on zoom off zoom out zoom reset zoom zoom xon zoom yon zoom(factor) zoom(fig, option) Description zoom on turns on interactive zooming. When interactive zooming is enabled in a figure, pressing a mouse button while your cursor is within an axes zooms into the point or out from the point beneath the mouse. Zooming changes the axes limits. * For a single-button mouse, zoom in by pressing the mouse button and zoom out by simultaneously pressing Shift and the mouse button. * * For a two- or three-button mouse, zoom in by pressing the left mouse button and zoom out by pressing the right mouse button. Clicking and dragging over an axes when interactive zooming is enabled draws a rubber-band box. When the mouse button is released, the axes zoom in to the region enclosed by the rubber-band box. Double-clicking over an axes returns the axes to its initial zoom setting. zoom off turns interactive zooming off. zoom out returns the plot to its initial zoom setting. zoom reset remembers the current zoom setting as the initial zoom setting. Later calls to zoom out, or double-clicks when interactive zoom mode is enabled, will return to this zoom level. zoom toggles the interactive zoom status. zoom xon and zoom yon set zoom on for the x- and y-axis, respectively. zoom(factor) zooms in or out by the specified zoom factor, without affecting the interactive zoom mode. Values greater than 1 zoom in by that amount, while numbers greater than 0 and less than 1 zoom out by 1/factor. zoom(fig, option) Any of the above options can be specified on a figure other than the current figure using this syntax. Remarks zoom changes the axes limits by a factor of two (in or out) each time you press the mouse button while the cursor is within an axes. You can also click and drag the mouse to define a zoom area, or double-click to return to the initial zoom level. Best fishes Sam Sam McClatchie, Biological oceanography South Australian Aquatic Sciences Centre PO Box 120, Henley Beach 5022 Adelaide, South Australia email <[EMAIL PROTECTED]> Telephone: (61-8) 8207 5448 FAX: (61-8) 8207 5481 Research home page <http://www.members.iinet.net.au/~s.mcclatchie/> /\ ...>> <°)Xx><< / \\ ><(((°> >><(((°> ...>>O<°)Xx><< __ 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] r-help
There is a function 'simMD()' in 'popgen' library which simulates a sample of genotype data as follows: > library(popgen) > x <- simMD(20, 2, 2, p = NULL, c(0.09, 0.05), ac = 2, beta = 1) > x , , 1 [,1] [,2] [1,]11 [2,]11 ... [37,]12 [38,]22 [39,]22 [40,]22 , , 2 [,1] [,2] [1,]22 [2,]12 [3,]12 ... [38,]21 [39,]12 [40,]12 > How can I repeat this function, for example, 1000 times to generate 1000 samples and assign each output to distinct 'vector' Xi, where i=1,2,...,1000 The goal is to generate a large number of samples using this function and then use them in further analysis. Any suggestions would be appreciated Sitdikov Mansor ______ 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--package:MIX
Hi all, The package MIX is for estimation and multiple imputation for mixed categorical and continuous data. I want to use multiple imputation to impute the missing values in the covariates of Cox model, I am wondering if I could use MIX to do that. I mean that my dataset is failure time distribution, dose MIX limit the dataset only for multivariate normal datasets with missing values as package NORM? Thank you for help, Jia __ 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: PLSR
Hello, I have a data set with 15 variables (first one is the response) and 1200 observations. Now I use pls package to do the plsr with cross validation as below. trainSet = as.data.frame(scale(trainSet, center = T, scale = T)) trainSet.plsr = mvr(formula, ncomp = 14, data = trainSet, method = "kernelpls", CV = TRUE, validation = "LOO", model = TRUE, x = TRUE, y = TRUE) after that I wish to obtain the value of "se", estimated standard errors of the estimates(cross validation), mentioned in the function of MSEP, but not implemented yet, so I made the program by myself to calculate it. The results I got seem not right, and I wonder which step below is wrong. y = trainSet.plsr$y p = as.data.frame(trainSet.plsr$validation$pred) i = 1; msep_element = matrix(nrow = 1200, ncol = 14) while(i <= length(p)){ msep_element[,i] = (p[i]-y)^2 i = i + 1 } msep = colMeans(msep_element) msep_sd = sd(msep_element) Then I compare "msep" with "trainSet.plsr$validation$MSEP", which are the same, but the values of "msep_sd" seem much larger than I expected, is it the same as "se"? If not, how to calculate "se" of cross validation? Thank you, Shengzhe __ 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] R Help
Hi, I have query regarding R & Rserve. In Rserve, there is a way to capture Errors by RSrvException class, but is there any way to capture warning messages? I have found that there is "warnings()" command in R, which lists the last warning message, but I am not able to get the warning message in java program by executing the following line: REXP rx = null; rx = connection.eval("x<-sqrt(-9)"); // will generate warning message connection.eval("warnings()").asString(); // this displays null instead of warning message Please reply me correct way, if any, to display warning message. Regards, Nikhil Shah [[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
Re: [R] Help
Dear Claire Thank you for providing an example, but it is not totally clear to me how you want to transform your data. For example in row 1, you have value 1 in column f and n, but the results after transformation are not similar "A G" and "A A". Similar problem for column h and i. They transform both to "G G" although the original values 0,2 differ? Furthermore it is not clear if you want to have a vector with two elements as result of the transformation -> "A" "G" or one character "A G". In the first case you cannot work with data.frames or matrices, but you must use a list. An entry of a data.frame is always a single element. Regarding changing elements if they fulfil a condition, it is not necessary to work with loops. E.g. for a vector v[v==5] <- 7 changes all values of v which are 5 to 7. Please read "An Introduction to R" on the R home page about indexing vectors, matrices, and so on. The following code can show you an example how I understood your problem and one possible solution. I hope it helps you. ## Create data.frame DF <- data.frame(a = c(14,58), b = c(24,42), c = c("rcvf", "grde"), d = c("AG","AC"), e = c(5,2), f = c(2,5), g = c(1,0), h = c(0,5), i = c(2,1), n = c(1,0)) ## work with matrix to avoid problems with factors DF <- as.matrix(DF) ## transformation function myfun <- function(v) { v[v=="5"] <- "00" v[v=="1"] <- v["d"] v[v=="0"] <- paste(rep(substr(v["d"],1,1), 2), collapse = "") v[v=="2"] <- paste(rep(substr(v["d"],2,2), 2), collapse = "") v } ## apply transformation function to all rows result <- t(apply(DF, 1, myfun)) One final point. Providing examples is a good way to obtain fast help from others. Could you please try to give some R-code in the example as well to ease the handling for others, e.g. if you provide an example data.frame, please include the code to produce it: ## Create data.frame DF <- data.frame(a = c(14,58), b = c(24,42), c = c("rcvf", "grde"), d = c("AG","AC"), e = c(5,2), f = c(2,5), g = c(1,0), h = c(0,5), i = c(2,1), n = c(1,0)) Have a nice week and enjoy further working with R. Regards, Christoph Buser -- Christoph Buser <[EMAIL PROTECTED]> Seminar fuer Statistik, LEO C13 ETH Zurich 8092 Zurich SWITZERLAND phone: x-41-44-632-4673 fax: 632-1228 http://stat.ethz.ch/~buser/ -- claire pujoll writes: > Dear R members, > > Sorry for this question. I have a dataframe (please see the example) and i > should do the following transformation: > > DF > abc d e f g h i n > 14 24 rcvfAG5 2 1 0 2 1 > 58 42 grde AC2 5 0 5 1 0 > > > I should transforme my DF like : > > abcd ef g h in > 14 24 rcvf A G0 0 G GA G G G G G A A > 58 42 grdeA CC C 0 0 A A0 0 A C A A > > i.e: when DF[i,j]==5 => DF[i,j] <- 0 0 > When DF[i,j] == k (!=0) i should look to d column to do the > transormation > > DF is 20 * 1 so i cant use loops. > > Thanks for your help, > Claire > > [[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-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-help
Hello I need help with the way to install nls2 library for windows, or the script that can be used for install the nls2 library. Do you know if this library works in windows? Best regards. Diego Rojas Cali-Colombia __ 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: predict.qda
Hello, I use the function qda (package MASS) to obtain a qda object like below. x.qda = qda(x, group) the group is a factor of two levels and use this object to do the prediction below. y.pred = predict(x.qda, y) after that, I set different prediction priors like below, but the results of prediction are totally the same as above using prior of training set (use all.equal to compare). y.pred1 = predict(x.qda,y, prior = c(1, 0)) y.pred2 = predict(x.qda,y, prior = c(0.5, 0.5)) y.pred3 = predict(x.qda,y, prior = c(0, 1)) y.pred4 = predict(x.qda,y, prior = c(0, 0)) the prediction prior of the last one should be wrong, but I still got the same result. And I tested the example of the function predict.qda by setting a prediction prior. predict(z, test, prior = c(0.1, 0.1, 0.8)) this result is exact the same as "predict(z, test)" which use training prior "c(0.333, 0.333, 0.333)" If the prediction prior for qda does not work? The version of R I use is 2.1.1, and this argument for lda works. Thank you, Shengzhe ______ 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: predict.qda
Hello, I use the function qda (package MASS) to obtain a qda object like below. x.qda = qda(x, group) the group is a factor of two levels and use this object to do the prediction below. y.pred = predict(x.qda, y) after that, I set different prediction priors like below, but the results of prediction are totally the same as above using prior of training set (use all.equal to compare). y.pred1 = predict(x.qda,y, prior = c(1, 0)) y.pred2 = predict(x.qda,y, prior = c(0.5, 0.5)) y.pred3 = predict(x.qda,y, prior = c(0, 1)) y.pred4 = predict(x.qda,y, prior = c(0, 0)) the prediction prior of the last one should be wrong, but I still got the same result. And I tested the example of the function predict.qda by setting a prediction prior. predict(z, test, prior = c(0.1, 0.1, 0.8)) this result is exact the same as "predict(z, test)" which use training prior "c(0.333, 0.333, 0.333)" If the prediction prior for qda does not work? The version of R I use is 2.1.1, and this argument for lda works. Thank you, Shengzhe ______ 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: PLSR
Hello, I have a data set with 15 variables (first one is the response) and 1200 observations. Now I use pls package to do the plsr as below. trainSet = as.data.frame(scale(trainSet, center = T, scale = T)) trainSet.plsr = mvr(formula, ncomp = 14, data = trainSet, method = "kernelpls", model = TRUE, x = TRUE, y = TRUE) from the model, I wish to know the values of Xvar (the amount of X-variance explained by each number of components) and Xtotvar (total variance in X). Because the trainSet has been scaled before training, I think Xtotvar should be equal to 14, but unexpectedly Xtotvar = 16562, and the values of Xvar are also very big and sum of Xvar = 16562. Why does this type of result occur? for the reason of kernel algorithm? Thank you, Shengzhe ______ 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] help
On 05-Sep-05 Dominique Katshunga wrote: > Dear helpeRs, > I seem to be a little bit confused on the result I am getting from the > few codes below: >> u=v=seq(0,1,length=30) >> u > [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 > [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 > [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 > [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 > [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. >> v > [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 > [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 > [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 > [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 > [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. >> f=function(x,y){cp=max(x+y-1,0)} >> z=outer(u,v,f) > z is a 30x30 matrix which is fine, but why all its entries are equal to > 1? for example, the maximum between u[22]+v[22]-1 and 0 is not 1?? I > don't really know where I went wrong! > thanks, > Dominique A trap easy to fall into! First, note from "?outer" that "FUN" must be a function which "operates elementwise on arrays". In other words, given two array arguments (x,y), for each element of x and the corresponding element of y, it returns a value. However, 'max' is not such a function (despite intuitive expectations). Specifically: max(u+v-1,0) [1] 1 In other words, 'max' is like 'sum': it evaluates a single result for the whole array. However, if you look at "?max" and read far enough, you will find 'pmax' -- "parallel maximum" -- which does it element by element. Look at pmax(u+v-1,0) So try f<-function(x,y){pmax(x+y-1,0)} outer(u,v,f) The reason this is a trap is that without looking at the code for 'outer' one might perhaps expect that 'outer' picks in turn each possible pair of values (u[i],v[j]) and passes this pair as a set of two numbers (x,y) to f(x,y). This is not so: it passes the entire array of pairs all at once. When "FUN" is 'max' it returns the maximum of this entire array for each position in the array! Look at the code for 'outer' to see how this happens: just enter outer The clue is in the line robj <- array(FUN(X, Y, ...), c(dX, dY)) Best wishes, Ted. E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 05-Sep-05 Time: 16:11:22 -- XFMail -- __ 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] help
On Mon, 5 Sep 2005, [EMAIL PROTECTED] wrote: > A trap easy to fall into! > So easy, in fact, that it's a FAQ. -thomas __ 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] help
howzit dom i just saw your mail now! i tried the following and got an error: > u=v=seq(1,3) > u [1] 1 2 3 > v [1] 1 2 3 > f=function(x,y){max(x+y-1,0)} > z=outer(u,v,f) Error in outer(u, v, f) : dim<- : dims [product 9] do not match the length of object [1] it seems s if r is not performing elementwise maximisation!!! all you need is: f=function(x,y){pmax(x+y-1,0)} z=outer(u,v,f) ok lets try it!!! i used length =5 to save space u=v=seq(0,1,length=5) f=function(x,y){pmax(x+y-1,0)} z=outer(u,v,f) z [,1] [,2] [,3] [,4] [,5] [1,]0 0.00 0.00 0.00 0.00 [2,]0 0.00 0.00 0.00 0.25 [3,]0 0.00 0.00 0.25 0.50 [4,]0 0.00 0.25 0.50 0.75 [5,]0 0.25 0.50 0.75 1.00 think this works! check ?pmax see ya allan Dominique Katshunga wrote: > > Dear helpeRs, > I seem to be a little bit confused on the result I am getting from the > few codes below: > > u=v=seq(0,1,length=30) > > u > [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 > [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 > [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 > [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 > [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. > > v > [1] 0. 0.03448276 0.06896552 0.10344828 0.13793103 0.17241379 > [7] 0.20689655 0.24137931 0.27586207 0.31034483 0.34482759 0.37931034 > [13] 0.41379310 0.44827586 0.48275862 0.51724138 0.55172414 0.58620690 > [19] 0.62068966 0.65517241 0.68965517 0.72413793 0.75862069 0.79310345 > [25] 0.82758621 0.86206897 0.89655172 0.93103448 0.96551724 1. > > f=function(x,y){cp=max(x+y-1,0)} > > z=outer(u,v,f) > z is a 30x30 matrix which is fine, but why all its entries are equal to > 1? for example, the maximum between u[22]+v[22]-1 and 0 is not 1?? I > don't really know where I went wrong! > thanks, > Dominique > > ______ > 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@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] Help ...
It's because you've asked R to create an object of size 5 * 4 * 12488 * 1000 * 8 bytes, or 1905.5 MB, and R failed to get that much memory from the operating system. Andy > From: Gao Fay > > Hi there, > > When I run the following, why does it give a error like that? > > > res2<-array(0,c(5,4,12488,1000)) > Error: cannot allocate vector of size 1951250 Kb > > Thank you for helping me. > Fay > > __ 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] R help
Dear Sir/Madam, My purpose is to write an R function to solve the quadratic equation ax2+bx+c=0. The input should be an array of a, b, and c from a data set a b c 1 4 3 1 4 5 0 2 5 0 0 6 The output with the possibility of complex roots and one root or no root should look like the following. ABCREAL1IM1REAL2IM2 143 -1.0 . -3 . 145 -2.0 1 -2 -1 025 -2.5 .. . 006 . .. . I get the code in reading in the coefficient data and outputing the results to a data set for eventual printing. Please help me in adding the R code that solves for the quadratic in place of the comments. a <- c(1,1,0,0) b <- c(4,4,0,0) c <- c(3,5,5,6) SolveQuad <- function(a,b,c) { ## Put the answer in y.solution a vector of length 4 y.solution <- rep(-999,4) if (a == 0) { if (b!= 0) {y.solution[1]<- -1*c/b} } else ## Put your R code here } else { ## Put your R code here } y.solution } # Interate through the coefficients y <- matrix(0,nrow=4,ncol=4) for (k in 1:4) { y[k,] <-SolveQuad(a[k],b[k],c[k]) } y Thanks very much for all the help! yuying shi [[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
Re: [R] help
Natalie O'Toole wrote: > Hi, > > Would anyone know how to calculate the modal value of LeafArea? > > Thank-you very much!! > > Nat > > __ > > Hi all, > > I have 2 questions: > > 1)How do I calculate the mean on an imported txt file? I've imported the > file below and that's what it looks like imported. How do I then calcuate > the mean, median, or mode on the column LeafArea using the desktop R > package? > Hi Nat, Try this: leaf.df<-read.table("leafdata.csv",header=TRUE) library(prettyR) describe(leaf.df) Mode(leaf.df$LeafArea) Jim ______ 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] Help
Do you mean something like this? > mat <- cbind(rnorm(330),rnorm(330),rnorm(330),rnorm(330)) > head(mat) [,1][,2][,3] [,4] [1,] -0.4668818 0.03015618 -0.72568113 0.6053179 [2,] -0.2625691 -2.20022333 -0.93728544 0.5455864 [3,] -3.4599164 0.71049089 -0.91545599 -1.6744806 [4,] -1.2757082 -1.27079001 0.95844728 -0.1208091 [5,] 0.7761458 -0.38686485 -1.51233490 -2.0337612 [6,] 0.5032718 0.40763612 0.08763122 0.9083149 > sel <- seq(1,330,by=30) > matplot(t(mat[sel,]),type="b",pch=15) For principal components analysis, ?princomp or ?prcomp On 14/09/06, Ben Salah Mohamed Selim <[EMAIL PROTECTED]> wrote: > > Hello, > I am a new user of R statistical project. So, I have a matrix (4 columns > and 330 rows) and I would like to have PCA (Principal Component Analysis). > Besides, I would like to draw every 30 rows from 330 with a different colour > but I don't know how. > Could you help me by showing how can I draw every 30 rows with a > different colour? > Thank you very much > Selim > > - > Découvrez un nouveau moyen de poser toutes vos questions quelque soit le > sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos > opinions et vos expériences. Cliquez ici. > [[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. > > > -- = David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP [[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] Help copy.file()
Dear R user, I have a little truble using the command copy.file() because R copy the files but trasform all of them from their kb weight to 0 kb! I tried with different kind of file extension as .doc, .png, .pdf and the result is the same: all files are copied to ther right folder and path but every file have 0 kb of weight and result unavailable. Of course, I want to copy file, expecially charts in .png format, created by R from a folder in a PC to a folder in another PC that is a web server. Have you any ideas? Thanks a lot. MARCO __ 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 needed
I tried to use "paneliperf" in package SensoMinR, I imported my data "Choco" , my data looked like exactly same with data "sensochoc" in this package. the only difference is the value. I tried to run the code, res<-paneliperf(choco, formul = "~Product+Panelist+Session+ Product:Panelist+Product:Session+Panelist:Session", formul.j = "~Product", col.j = 1, firstvar = 5, synthesis = TRUE), the error message is "Error in `[.data.frame`(aux, 1, 5) : undefined columns selected" What is that , how to fix that? Thank a lot. - [[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] R help
*I am a very new user of R. I've spent several hours trying to import data, I am successful in importing data from Excel. After having the data on R console, I am not understanding how to make a file for imported data,so I feel okay asking the list for help. * *I have used save workspace option from file menu. but when i have to use that saved workspace in extReme toolkit using read data option from file menu I am getting the following messages* ** *Error in read.table("C:/Program Files/R/R-2.4.0/Rainfall Data/lahore", : more columns than column names In addition: Warning message: incomplete final line found by readTableHeader on 'C:/Program Files/R/R- 2.4.0/Rainfall Data/lahore' Error in parse(file, n = -1, NULL, "?") : syntax error* ** *I request you to please guide to me.* *Regards *AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [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] R Help
Respected Sir I am very new user of R language. Sir i am facing problems in learning R language reading manuals. Sir is there any possibility of learning it by some tutor online? Sir my research work is going to be late because of not having understanding of R. After a long struggle, I am just able to import data. But i am unable to save it as a data file. Sir I request you to please give me some instructions. And how I can make it easier for learning it. I shall be very thank ful to you for your help. Regards -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [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] R Help
Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", row.names, col.names, as.is = !stringsAsFactors, na.strings = "NA", colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = "#", allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="", ...) read.delim(file, header = TRUE, sep = "\t", quote="\"", dec=".", fill = TRUE, comment.char="", ...) I shall be really thankful to you. REGARDS -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Years lrmax n1 n2 n3 n4 arranged 1980207.6 25 24 23 22 29.4 198192.724 23 22 21 49.4 198267.523 22 21 20 55.1 198393.822 21 20 19 58 198460.621 20 19 18 59 1985117.4 20 19 18 17 59.1 198665.319 18 17 16 60.6 198759.118 17 16 15 65.3 198876.917 16 15 14 67.5 1989123.1 16 15 14 13 69.6 199083.115 14 13 12 75.7 199175.714 13 12 11 76.8 199269.613 12 11 10 76.9 199355.112 11 10 9 83.1 199449.411 10 9 8 84.2 199576.810 9 8 7 87 1996189.7 9 8 7 6 88.2 1997151.1 8 7 6 5 92.7 199859 7 6 5 4 93.8 199988.26 5 4 3 110 2000110 5 4 3 2 117.4 200187 4 3 2 1 123.1 200229.43 2 1 0 136.8 200384.22 1 0 0 151.1 200458 1 0 0 0 189.7 2005136.8 0 0 0 0 207.6 __ 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] help
The word ``help'' does NOT constitute an informative subject line. cheers, Rolf Turner [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.
Re: [R] help
In case you haven't already received an adequate reply (which I haven't seen) or figured this out on your own, I will comment. Consider the following modifications of an example in the 'lmer' documentation: (fm0.0 <- lmer(Reaction~(1|Subject), sleepstudy)) (fm0.1 <- lmer(Reaction~1+(1|Subject), sleepstudy)) (fm0.s <- lmer(Reaction~Subject+(1|Subject), sleepstudy)) The first two models are equivalent, as can be seen from looking at the output. In the "formula" language, something like "Reaction~X" means to estimate an intercept plus an X effect. If you want a no-constant model, you must specify "Reaction ~ -1+X". When X is a factor, "Reaction ~ -1+X" effectively fits the same model as "Reaction~X" using an alternative parameterization. If X is numeric, "Reaction~X" means estimate b0 and b1 in Reaction = b0 + b1*X + error. Meanwhile, "Reaction ~ -1+X" means estimate only b1 in Reaction = b1*X + error. In this latter case, the introduction of "-1" actually changes the model. The third model "Reaction~Subject+(1+Subject) is a confusion: The "~Subject" part asks lmer to estimate a separate parameter for each Subject. The (1|Subject) term asks lmer to estimate the standard deviation for between-Subject random variability after the fixed effects are removed. Since Subject is also listed as a fixed effect in this model, the model is overparameterized: I'm not certain, but it appears to me that the software doesn't know whether to allocate subject-specific deviations from the overall mean to the fixed effects coefficients or the random effect, and it appears to do a little of both. It might be nice if 'lmer' included a check for factors appearing as both fixed and random effects. However, I believe that 'lme4' and (R more generally) is primarily a research platform for new statistical algorithm development. Most of the R Core Team work to maintain R under the GNU license primarily because it supports their research (and educational) objectives. The product therefore may not strive to be as supportive for naive users as commercial software. Hope this helps. Spencer Graves Aimin Yan wrote: > consider p as random effect with 5 levels, what is difference between these > two models? > > > p5.random.p <- lmer(Y > ~p+(1|p),data=p5,family=binomial,control=list(usePQL=FALSE,msV=1)) > > p5.random.p1 <- lmer(Y > ~1+(1|p),data=p5,family=binomial,control=list(usePQL=FALSE,msV=1)) > > thanks, > > Aimin Yan > > __ > 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] Help
How do you propose to forecast? If it were me, I'd first worry about what to use to model, then the forecasting. I'd start with normal probability plots to make sure I didn't have any outliers, need a transformation, etc. If all looked plausibly normally distributed, I might first fit a linear regression model using "lm", then do "acf" and "pacf" of the residuals, select a time series model for the residuals, and fit the full model using "arima". The output from "arima" is a list, one of whose components is "residuals", which are the one-step ahead forecast errors. To compute the one-step ahead predictions, I believe you just subtract those from the observations. However, there is also a "predict" function that has an "arima" method, and I would use that to spot-check the numbers to make sure I understood. Do you have Venables and Ripley (2000) Modern Applied Statistics with S, 4th ed. (Springer)? If you aren't already familiar with the chapter in that book on time series, I suggest you start there. If you'd like further help from this group, I suggest you first PLEASE do read the posting guide! "www.R-project.org/posting-guide.html": Anectotal evidence suggests that questions that follow more closely the recommendations in the posting guide tend to get more useful answers quicker. hope this helps. spencer graves Sumanta Basak wrote: > Hi R-Users, > > > > I apologize if it is too simple question for all. I have a multivariate > dataset having 7 variables as independent and 1 dependent variable. 248 > data points are there. I want to do out sample forecast first > considering 156 points. So I'll have to start from 157th point and > calculate the 157th y_hat value. In this way it will go to 248th data > point. Can any one tell me how I can do with for loop. Thanks a lot in > advance. > > > > > > Thanks & Regards, > > SUMANTA BASAK. > > > --- > This e-mail may contain confidential and/or privileged infor...{{dropped}} > > __ > 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 -- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA [EMAIL PROTECTED] www.pdf.com <http://www.pdf.com> Tel: 408-938-4420 Fax: 408-280-7915 __ 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: chisq.test
I have two groups of patients (improved or not improved) named x and y group respectively after being treated with 5 different drugs X<-c(43,52,25,48,57) and Y<-c(237,198,245,212,233) when I run chisq.test(cbind(x,y)) I get a p value of <0.0024 but if I run chisq.test(x,y) I get a p value of 0.22 not significant at 5% what is the difference between the two thanks bragadeesh ______ 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] R help
Hi, I wonder whether R can finish the following project: I want to make a chart to represent 10 genes. Each gene has orientation and length. Therefore, a gene can be represented by arrows. Can R be used to draw 10 arrows in one line ? scott - [[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] help again
hi i try to use arima and holtwinter to predict drought from 1895-2006 but i cannot read whole period of time and i try to do the exponent fitting, but it comes out as the coordinate x-y error i send the source code and data to take a look if anyone can help me, i am really new in R thank u so much jam __ 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 Needed!!
Hi, Can anyone help me with repeated meausres MANOVA in R ? For repeated measures ANOVA I used function "aov". Is there something like this exists for MANOVA? Thanks, Deepa - [[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] help
On Mon, 2006-04-17 at 10:17 -0400, Gong, Yanyan wrote: > Hi, I am trying to runn a age-period-cohort model, but here is what I am > having problem with, hope you can help me! > > This is what I am trying to do: > sumzero_a<-((A-min(A))/5+1) - mean((A-min(A))/5+1) where A is my age > variable (numeric, the mid-point of a five-year age group), but I got the > following error: > > Error in min(..., na.rm = na.rm) : invalid 'mode' of argument > > I am pretty sure I have the variable "A" in my data, can you see why this > happens? > > Thanks. > > Yanyan 'A' does exist or you should get something like the following: > min(A) Error in min(A) : object "A" not found More than likely, 'A' is not a numeric vector. It could be a character vector, a list or some other non-atomic data type. It is not a factor, lest you get something like the following: Error in Summary.factor(..., na.rm = na.rm) : min not meaningful for factors See ?is.atomic for some additional information. Without your code, it would be difficult to ascertain how 'A' is created. However, consider the following example: > L <- LETTERS > L [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" [18] "R" "S" "T" "U" "V" "W" "X" "Y" "Z" > min(L) Error in min(..., na.rm = na.rm) : invalid 'mode' of argument > mode(L) [1] "character" I would use: str(A) or mode(A) to see what 'A' is. That should give you a hint. HTH, Marc Schwartz __ 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] help
Hi Marc, I figured out the problem, when I ran a glm model earlier, I used A as it's name. Now the program is working.., a good lesson to learn. Thank you so much for you help! Yanyan -Original Message- From: Marc Schwartz (via MN) [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 2:20 PM To: Gong, Yanyan Subject: RE: [R] help On Mon, 2006-04-17 at 13:40 -0400, Gong, Yanyan wrote: > Hi Marc, > > I checked, A is a numeric field, here is my data frame: > > `data.frame': 91 obs. of 4 variables: > $ A: num 22.5 27.5 32.5 37.5 42.5 47.5 52.5 57.5 62.5 67.5 ... > $ P: int 1970 1970 1970 1970 1970 1970 1970 1970 1970 1970 ... > $ D: int 55 180 303 349 437 489 386 383 334 229 ... > $ Y: int 1602127 1340887 1122499 1043250 1005940 926649 766054 > 700415 613063 537763 ... > > But when I do "min(A)", I got "Error in min(..., na.rm = na.rm) : > invalid 'mode' of argument". I checked mode(A), it says it is a > "list". I am sure A was created as a numeric variable, and the program > used to work. After I changed the working directory, I kept getting > problems. The weird thing is the following works: > > sumzero_p<-((P-min(P))/5+1) - mean((P-min(P))/5+1) > sumzero_c<-((cohort-min(cohort))/5+1) - mean((cohort-min(cohort))/5+1) > > In which, p is numeric variable for period, cohort is another numeric > variable for birth year. > > Hope this gives you a hint of my problem. Thanks very much! > > Sincerely. > > Yanyan Yep...'A' is numeric, but it is a column in a data frame. You might want to review An Introduction to R, specifically section 6 and forward regarding the means by which one refers to columns in a data frame. http://cran.r-project.org/doc/manuals/R-intro.html#Lists-and-data-frames I would check to see which 'P' is being referred to in your code above. Did you use: attach(data.frame) at some point? If not, then 'P' is _not_ the P in your data frame, but some other locally created 'P'. You can use: ls() to list the current objects that you have created. If you don't want to use attach/detach, you can use: data.frame$A to refer to 'A'. Similar syntax for the other columns. Also, remember that R is case sensitive, so: p != P If you elect to use attach(), be sure that you use the complementary detach() as well. BTW, using 'data.frame' as the name for your data frame is bad, since it is also the name of a function, data.frame(). In most cases, R will be able to tell the difference, but you risk getting bitten by an occasion where it cannot. Lastly, while I don't mind helping, when replying to a post on the list, please respond back to the list as well (ie. Reply to All), so that the thread integrity is maintained to help others via the list archive and to enable others to respond. HTH, Marc This e-mail message (and any attachments) may contain confid...{{dropped}} __ 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] R-Help
Dear r-users, Suppose I have three datasets: Dataset-1: Date x y Jan-1,2005120 230 Jan-2,2005123 -125 Jan-3,2005-110 300 Jan-4,2005114 -21 Jan-7,200511299 Mar-5,2005200 311 Dataset-2: Date x y Jan-2,2005123 -125 Jan-3,2005-110 300 Jan-4,2005114 -21 Jan-5,200511299 Jan-6,2005-23 12 Mar-5,2005200 311 Dataset-3: Date x y Jan-3,2005-110 300 Jan-4,2005114 -21 Jan-5,200511299 Mar-5,2005200 311 Apl-23,2005 123 200 Now I want to get the common dates along with x and y from this above three datasets keeping the same order in date-variable as it is. For ex. I want to get: Datex y xy x y (from dataset-1) (from dataset-2) (from dataset-3) Jan-3,2005-110 300 -110 300 -110 300 Jan-4,2005 114 -21 114-21 114 -21 Mar-5,2005200 311 200 311 200 311 Can anyone give me any R code to implement this for any number of datasets ? Thanks and regards thanks in advance - [[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
[R] R help
Hello, I'm trying to create a large matrix and it's extends the limit boundaries. The matrix is 100,000x2874 and R is throwing me out, what shall i do? Thanks Erez ______ 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] R help
Hi, There is anyway to run R script on c++? Erez __ 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 needed
Hi, I am trying to change a SAS macro to R. here is my code. I get an error at the last line. attach(fram) dset1<-cbind(AGE,BMI,DEATH) > BMIGRP<-cut(BMI,breaks=3,right=TRUE) > AGEGRP<-floor(AGE/10)-2 > dset<-cbind(AGEGRP,BMIGRP,DEATH) > maxage<-max(dset[,1]) > minage<-min(dset[,1]) > #maxcls<-dset[,2] > #mincls<-dset[,2] > nage<-maxage-minage+1 > nclass<-maxcls-mincls+1 > nsub<-nrow(dset) > weight <- matrix(,nage,1) > for ( i in minage:maxage ) + {weight[i-minage+1,1] = sum(std = i)} > > atrisk = matrix(,nclass,nage) > wevents = matrix(,nclass,nage) > #reduce data set to frequency table > for( i in (minage : maxage)) + for( j in (mincls : maxcls)) + #atrisk1<-aggregate(dset[,c("AGEGRP","BMIGRP")],list(RANDID=dset1$RANDID,sum) + + {atrisk[j-mincls+1,i-minage+1] = + sum((dset[,1]=i)& (dset[,2]=j)) + wevents[j-mincls+1,i-minage+1]= + sum((dset[,1]=i)& (dset[,2]=j)&(dset[,3]=1))} Error: subscript out of bounds In addition: Warning messages: 1: numerical expression has 11627 elements: only the first used in: mincls:maxcls 2: numerical expression has 11627 elements: only the first used in: mincls:maxcls Any help will be greatly appreciated. Thanks, Anamika ----- [[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
[R] R help
Hello, I'm working with large matrix data and i would like to know if there is any way to reduce the size of it because even that I'm increasing the memory limit and that i have 1 gb memory the program throwing me out. There is any way to use a smaller size data (such as using bits or so) to reduce the size of it. Erez ______ 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] help
Anamika Chaudhuri yahoo.com> writes: > I was trying to calculate an age adjusted rate for which we have the formula as > sum(weight*rate)/sum(weight). I am using the framingham dataset called fram here.I cant figure out how I > could change the logical statement I have for the standard dataset (in red) to calculate weight and > calculating the wevents and atrisk(in red) ... lengthy code follows If you want to get an answer, provide as good subject line and a data set (e.g. part of Framingham). Nobody loves to wade through so many lines of code without the chance to check out what is intended. Dieter __ 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] help
Hi I agree with Dieter. I think you are probably looking for some aggregation function (aggregate, tapply, by,...), but it is only a guess. Sometimes it help me to answer my questions myself before I actually post it to Rhelp when I try to elaborate an example using artificial simple data for others to understand what I am trying to do and how I fail. HTH Petr On 27 Apr 2006 at 6:20, Dieter Menne wrote: To: r-help@stat.math.ethz.ch From: Dieter Menne <[EMAIL PROTECTED]> Date sent: Thu, 27 Apr 2006 06:20:44 + (UTC) Subject: Re: [R] help > Anamika Chaudhuri yahoo.com> writes: > > > I was trying to calculate an age adjusted rate for which we have > > the > formula as > > sum(weight*rate)/sum(weight). I am using the framingham dataset > > called fram > here.I cant figure out how I > > could change the logical statement I have for the standard dataset > > (in red) > to calculate weight and > > calculating the wevents and atrisk(in red) > > ... lengthy code follows > > If you want to get an answer, provide as good subject line and a data > set (e.g. part of Framingham). Nobody loves to wade through so many > lines of code without the chance to check out what is intended. > > Dieter > > ______ > 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] ______ 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] help
Hi as you are raised on Excel probably the best way for you would be: Start R Select the reagion in Excel you want to copy, preferably with a line of column headers Press Ctrl-C In R write my.first.data<-read.delim("clipboard") and you transferred your data to do analysis. However I recommend you to read some tutorials mentioned on CRAN or elsewhere and start with examples from these tutorials. As regarding the help pages (or man pages) they usually have some examples which you can copy to R console and see the results. Don't be afraid, you probably will not harm yourself or your computer by such trial and error attempts. ;-) HTH Petr On 17 May 2006 at 9:59, karim99.karim wrote: Date sent: Wed, 17 May 2006 09:59:32 +0200 From: "karim99.karim" <[EMAIL PROTECTED]> To: "R-help" Subject:[R] help > Dear Sir, > > Iam a French Student. Iam a new user of the Ť R ť Software. I dont > success to import data from Excel spreadsheet either using the > function (read.table) and the function (Rodbc). In addition, I dont > understand very well the help of the R Software. Could you please help > me and give a simple numerical example using this procedure : > read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", > row.names, col.names, as.is = FALSE, na.strings = "NA", colClasses = > NA, nrows = -1, skip = 0, check.names = TRUE, fill = > !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, > comment.char = "#", allowEscapes = FALSE, flush = FALSE) > read.csv(file, header = TRUE, sep = ",", quote="\"", dec=".", fill = > TRUE, ...) read.csv2(file, header = TRUE, sep = ";", quote="\"", > dec=",", fill = TRUE, ...) read.delim(file, header = TRUE, sep = "\t", > quote="\"", dec=".", fill = TRUE, ...) read.delim2(file, header = > TRUE, sep = "\t", quote="\"", dec=",", fill = TRUE, ...) > > > This is my e-mail: [EMAIL PROTECTED] > > > Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 > LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn) > > > > [[alternative HTML version deleted]] > > Petr Pikal [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
Re: [R] help
karim99.karim wrote: > Dear Sir, > > I’am a frensh student and i’am a new user of the R software. > > After using the command (x<-read.delim(“clipboard”) to read a spreadsheet of > Excel, I want to run the bds test and calculate the Lyapunov exponent. I have > charged the R software by the packages tseries and tseriesChaos. when i run > bds.test(x,m=2) Unfortunately the R software displays “error in > as.vector(x,mode= “double”) : the object (list) can not be automatically > converted on double” so what shall I do to run this two tests(lyapunov and > bds)? And what is my mistake? > > I thank you in advance and I’am waiting forward your e-mail > > This si my e-mail: [EMAIL PROTECTED] > > Accédez au courrier électronique de La Poste : www.laposte.net ; > 3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn) > > > > [[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 seems that the data import failed. probably the exported excel data are not in a format accepted correctly by read.delim. check this. alternative (maybe): there is an additional package 'gdata' on CRAN which you can download and install. it contains a function read.xls which can read directly the excel binary format (with some limitations). ______ 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] help
x is a data frame, since that is what read.table reads. bds.test is expecting (from the help file) x: a numeric vector or time series. so you probably want to pass x[[1]]. On Thu, 18 May 2006, karim99.karim wrote: Dear Sir, Iam a frensh student and iam a new user of the R software. After using the command (x<-read.delim(clipboard) to read a spreadsheet of Excel, I want to run the bds test and calculate the Lyapunov exponent. I have charged the R software by the packages tseries and tseriesChaos. when i run bds.test(x,m=2) Unfortunately the R software displays error in as.vector(x,mode= double) : the object (list) can not be automatically converted on double so what shall I do to run this two tests(lyapunov and bds)? And what is my mistake? I thank you in advance and Iam waiting forward your e-mail This si my e-mail: [EMAIL PROTECTED] Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn) [[alternative HTML version deleted]] -- 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
[R] Help: lme
-1,47.3182664676154 "861",431,8,-1,-1,40.8562323849786 "862",431,8,1,-1,43.8227177564303 "863",432,8,-1,-1,38.6147434757492 "864",432,8,1,-1,43.4166278016225 "865",433,8,-1,-1,41.4760591607769 "866",433,8,1,-1,45.5151189244384 "867",434,8,-1,-1,42.5880379424142 "868",434,8,1,-1,46.2124158667064 "869",435,8,-1,-1,44.8853462446185 "870",435,8,1,-1,46.9060165083782 "871",436,8,-1,-1,39.0322294910566 "872",436,8,1,-1,43.9859210398552 "873",437,8,-1,-1,41.4439699444237 "874",437,8,1,-1,47.1050635076745 "875",438,8,-1,-1,41.0967393490318 "876",438,8,1,-1,47.0221628983062 "877",439,8,-1,-1,43.99020036125 "878",439,8,1,-1,47.285080500439 "879",440,8,-1,-1,41.645152479906 "880",440,8,1,-1,45.6146694784334 "881",441,8,-1,-1,41.5597290392004 "882",441,8,1,-1,44.6176105927308 "883",442,8,-1,-1,39.7623930569069 "884",442,8,1,-1,43.8203345996138 "885",443,8,-1,-1,41.0890396795757 "886",443,8,1,-1,44.5620865831752 "887",444,8,-1,-1,41.2517213754205 "888",444,8,1,-1,44.9097619577072 "889",445,8,-1,-1,45.5991912380451 "890",445,8,1,-1,49.4770620094388 "891",446,8,-1,-1,45.4027924462001 "892",446,8,1,-1,49.9888735727176 "893",447,8,-1,-1,42.141251446893 "894",447,8,1,-1,44.6624491598329 "895",448,8,-1,-1,39.7867696878898 "896",448,8,1,-1,44.1349326048908 "897",449,8,-1,-1,38.8472805355899 "898",449,8,1,-1,42.0205371433417 "899",450,8,-1,-1,42.6598102499025 "900",450,8,1,-1,46.3831168163773 "901",451,8,-1,1,48.3204618201004 "902",451,8,1,1,54.3256107757768 "903",452,8,-1,1,53.2803022137228 "904",452,8,1,1,60.4579175896304 "905",453,8,-1,1,47.4964967066654 "906",453,8,1,1,55.8231300725903 "907",454,8,-1,1,49.3142313418368 "908",454,8,1,1,57.2809647557589 "909",455,8,-1,1,55.3289647207767 "910",455,8,1,1,63.4229453198523 "911",456,8,-1,1,46.1693473038714 "912",456,8,1,1,56.4164656858915 "913",457,8,-1,1,50.5717603953633 "914",457,8,1,1,56.6690697838869 "915",458,8,-1,1,47.9005744289753 "916",458,8,1,1,54.6918622541938 "917",459,8,-1,1,49.2880359481614 "918",459,8,1,1,58.0845336362533 "919",460,8,-1,1,47.9109900395313 "920",460,8,1,1,55.4492329637944 "921",461,8,-1,1,49.3961897710438 "922",461,8,1,1,57.0879173239499 "923",462,8,-1,1,48.0284330983694 "924",462,8,1,1,57.2260201005421 "925",463,8,-1,1,48.0084664366227 "926",463,8,1,1,54.3330658773719 "927",464,8,-1,1,49.0192611771315 "928",464,8,1,1,57.2479134944385 "929",465,8,-1,1,50.8665956403211 "930",465,8,1,1,58.6222010031123 "931",466,8,-1,1,51.9775887118509 "932",466,8,1,1,59.4907859812041 "933",467,8,-1,1,46.3365767549073 "934",467,8,1,1,55.3822967873779 "935",468,8,-1,1,48.1320091915411 "936",468,8,1,1,57.2777486871579 "937",469,8,-1,1,51.0152169849402 &qu
[R] R-Help
Respected Sir I am a very new user of R. I want to ask a question about "the nortest package". In this package how we can write the code of ad.test, cvm.test, ks.test for other distributions like GEV, GPA etc. I request you to please guide to me. Kind Regards AMNA -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [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.
Re: [R] help!
Hi most probably (, subset = some.call.which results in logical vector, ...) You certainly will find more information on specific help page. HTH Petr On 15 Feb 2007 at 22:55, [EMAIL PROTECTED] wrote: From: <[EMAIL PROTECTED]> To: r-help@stat.math.ethz.ch Date sent: Thu, 15 Feb 2007 22:55:43 +1100 (EST) Subject: [R] help! > I am learning to use R. What is the structure of the syntax for > specifying a subset of data in fitting GLMMs? > > wilford > > ______ > 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] __ 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 GAM
I think it will be better if I explained what I want to do. I have the abundance of Penilia (zooplankter) as y and I have the temperature, salinity and chlorophyll concentration at different depths. I want to know which how the abundance of Penilia is modulate by those environmetal variables and which factors are the most important ones. Please if you can said which are the steps that I have to follow (with the comands if it is possible) and how I can interpret the results. Is very urgent for me, I am waiting to these results to submitt a manuscript. Thank you, Dacha [[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] Help!!
Hi! Have you downloaded the package multilevel first? Best wishes, Karl ___ Bestellen Sie Y! DSL und erhalten Sie die AVM "FritzBox SL" für 0. Sie sparen 119 und bekommen 2 Monate Grundgebührbefreiung. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R-help
Dear R users, I have just start working with R and would need some help. If you have a matrix as: [,1][,2] [,3] [1,] 11 24 11 [2,] 16 29 16 [3,]215 2 and you want the position where you can find the maximum value, in this case row 2 and column 2. How could you get the position? The values in the matrix is likelihood function values, and each row and column represent values from two parameters. So the idea is to seek which parameter values maximise the likelihood and therefore I need boot row and column position. Regards Jim -- This e-mail and any attachment may be confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and then delete this e-mail and any attachment without retaining copies or disclosing the contents thereof to any other person. Thank you. -- [[alternative HTML version deleted]] __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help,
R-help, __ [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
[R] R-help
Dear all, Does anyone know how to read files with .dbf extension? Thanks for your time. __ [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
Re: [R] help!!!
On Tue, 26 Oct 2004, Jim Gustafsson wrote: > I will compare some results in a dotplot. > > The picture is very dark(grey) in the background, could I get it ligther? library(lattice) # is needed ?trellis.device # and see themes. However, if you get a very dark grey, your computer system is set up incorrectly, and you need to explore the `gamma' option (if implemented) to the graphics device you are using to get a mid grey (or get your monitor calibrated). > R-code > dotplot(LINES~VAL, > groups=QQ,key=simpleKey(levels(QQ1),space="top"),xlab="Values",main="Tail-Measure" > ) > > (where LINES,VAL, QQ is vectors) -- 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 __ [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
[R] R help
Hi, I was wondering as to how I could convert SPSS data imported to R into tabular form. In the sense, direct usage of read.table( ) doesnt help. Thanks - Meet the all-new My Yahoo! Try it today! [[alternative HTML version deleted]] __ [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
[R] Help requested .....
Happy New Year !!! I am working on a AIX machine with R Version 1.9.1 on AIX 5.2 ML-3. The perl.rte fileset is at 5.8.0.0 The following line is a part of a cgi script: open(T, "| /usr/local/bin/R --silent --no-save < /var/tmp/lll.input >/var/tmp/messages.out"); The contents of file /var/tmp/lll.input are as follows: tts.console(file="/var/tmp/wi.lll.dat",pfile="/var/tmp/wi.lll.ps") When the cgi script is executed /var/tmp/wi.lll.ps is not generated. However I invoke /usr/local/bin/R --no-save --min-vsize=20M --min-nsize=1000k < /var/tmp/lll.input from the command line, it executes correctly and also generates the post-script file /var/tmp/wi.lll.ps Are there any know issues with R working through UNIX pipes? Any help/hints offered is gratefully acknowledged. Regards, Sridhar ** IBM BCS - Public Sector Voice(303) 924 - 0413 Email[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
Re: [R] Help
I sent every one I know how to and every one I have sent this message to said you do not handle bonzi boost! But it funny you people are the one I spent $64.00 to get bonzi boost your computer. It made my computer work worse. As you people stated that you would refund my money if I was not happy with you product which I am not happy with. I sent the email on august 23rd. to refund my money and you people said you would refund my money in 8 to 10 working days . I GOT MY STATEMENT 2 WEEKS AGO. And it was not refunded! I would like my $64.00 dollars back! Every one I have sent this email to said you do not sell it for $64.00 then why did you people charge me $64.00 for it? I FEEL I AM GETTING THE RUN AROUND! so you dont half to refund my money back to me I sure hope you can help me with this prob. My under standing there was a 30day money back garante as you people stated.Is this just a come on or what?!! Please let me know a.s.a.p.!!! [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help me!
Would you help me to answer this question, please? /r/ is one of the most difficult English sounds to acquire and imitate. Describe in what ways it is different from our Spanish rolls (perro) and taps (pero). How does the pronunciation of this sound vary according to the context? Find at least three examples of linking r and intrusive r and transcribe into phonetics. When do we use them? Why are they used? I`ll waiting for your answer. Thanks Patricia [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Help
Stephen Opiyo wrote: Hi, I have a data set (data frame) approx. 50 rows * 600 columns. The columns are separated by commas. I would like to know how to remove those commas between the columns. What should I do to remove those commas? I guess during the import of the data? Please read the R Data Import/Export manual and the help page ?read.table. It tells you how to use the argument "sep". Secondly, if I want only to use part of the (data frame), say (50 rows * 300 columns) instead of (50 rows * 600 columns), what should I do? Index the data frame appropriately. See the manual "An Introduction to R". Also, the help page ?data.frame points you to subsetting methods in its "See Also" Section. Uwe Ligges Thanks, Stephen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Help!!
On Tue, 28 Jan 2003 16:01:06 +, you wrote in message <[EMAIL PROTECTED]>: > >Dear R ers, if some can tel me how I can generate a sample from a given >density. I have a complex 2D density function en I want to genearte >a sample from it? Any package? That's generally a hard problem, and the answer depends a lot on the particular characteristics of your distribution. The easiest general purpose method if you can calculate the density is probably MCMC, in particular random walk Metropolis; see the book Markov Chain Monte Carlo in Practice for details. This will give you a Markov chain that (hopefully) converges to your target distribution. If you only want a small sample, it's quite inefficient, but for a large sample (e.g. for estimating moments) it can be quite good. Support in R for MCMC is pretty much non-existent, but it's easy to write the chains yourself. Duncan Murdoch __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Help!!
If you have a dominating density, ie another density, say g, such that cg(x) On Tue, 28 Jan 2003 16:01:06 +, you wrote in message > <[EMAIL PROTECTED]>: > > > > >Dear R ers, if some can tel me how I can generate a sample from a given > >density. I have a complex 2D density function en I want to genearte > >a sample from it? Any package? __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help