Re: [R] Data scaled by lattice::stripplot

2012-06-28 Thread Pascal Oettli
Hello, It works with lattice::xyplot. Best Regards Le 29/06/2012 13:06, meonline a écrit : For the following example, library(lattice) df<-data.frame(i=1:100,p=runif(100),id=rep(c('a','b'),100)) summary(df[,'p']) Min. 1st Qu. MedianMean 3rd Qu.Max. 0.01165 0.33580 0.57520 0.53

[R] neatmap - draw.dendrogram - help!

2012-06-28 Thread mikey.willcox
Hi all, I'm having a problem where by I'm trying to use the NeatMap draw.dendrogram function as it is more versatile in placement/direction of dendrograms, instead of the limited plot function. Using plot I can get my dendrograms to display the species name for each leaf of the tree. But I cannot

Re: [R] loop through and modify multiple data frames

2012-06-28 Thread arun
Hello, I tried loop to modify the list, but unfortunately it was not successful.  But, I found another way to get the result you wanted (at least from what I understand). #Here are the datasets cats<-read.table(text=" name eats_kg 1 bob 3 2 garfield 4 3 chuck 6 ", sep="",header=TRUE) dogs<-read

Re: [R] Size of subsample in ecodist mantel()

2012-06-28 Thread nevil amos
Thanks Sarah, It is not clear to me exactly how I set this value. if I enter a value for pboot then the ulim==llim > X<-dist(1:100)> Y<-dist(1:100+50*rnorm(100))> length(X)[1] 4950> > print(mantel(X~Y,nperm=1000,nboot=1000,pboot=10)) mantelr pval1 > pval2 pval3 llim.2.5% ulim.

Re: [R] Fw: Extract upper case letters

2012-06-28 Thread mdvaan
Thanks, all solutions worked like a charm. Math arun kirshna wrote > > - Forwarded Message - > From: arun > To: mdvaan > Cc: R help > Sent: Thursday, June 28, 2012 1:44 AM > Subject: Re: [R] Extract upper case letters > > Hi, > > Try this: >

Re: [R] How can I make a list using aggregate function?

2012-06-28 Thread arun
Hi, The data is indeed very confusing.  It has four column names and five columns.  Assuming that zFEI is for fifth column, the fourth column is "Unknown1". dat2<-read.table(text=" sequence  weight rsat. Unknown1  zFEl  1    CCTTGTT    4.6  0.00058  -7.452 3.237  2    ACTTTGAGGTG

[R] estimating parameters of a model

2012-06-28 Thread Myo
Hi, I am about to conduct an experiment of temperature dependent development of an insect. Here I would like to know is if I could be able to find the parameters of the models what I will use in data analysis with R program. I have found some other softwares that can be used for parameter estimat

Re: [R] Data scaled by lattice::stripplot

2012-06-28 Thread meonline
Forgot the attachment :-( http://r.789695.n4.nabble.com/file/n4634810/Screenshot-1.png Screenshot-1.png -- View this message in context: http://r.789695.n4.nabble.com/Data-scaled-by-lattice-stripplot-tp4634809p4634810.html Sent from the R help mailing list archive at Nabble.com. ___

[R] the meaning of subscripts

2012-06-28 Thread startend
Hi, Now i am dealing with longitudinal data set and I want to see the rough marginal plot for 2 variables separately. I found the code from one example here, reading <- read.table("http://www.ats.ucla.edu/stat/R/examples/alda/data/reading_pp.txt";, header=T, sep=",") reading[reading$id %in% c(4,

[R] Data scaled by lattice::stripplot

2012-06-28 Thread meonline
For the following example, > library(lattice) > df<-data.frame(i=1:100,p=runif(100),id=rep(c('a','b'),100)) > summary(df[,'p']) Min. 1st Qu. MedianMean 3rd Qu.Max. 0.01165 0.33580 0.57520 0.53290 0.74540 0.98610 > stripplot(p~i|id,df) The plot that is output is as expected with the

Re: [R] Aggregate weights for a unique set of rows

2012-06-28 Thread Rui Barradas
Hello, Would around two orders of magnitude interess? f1 <- function(Nodes, Weights){ drop.index <- duplicated(Nodes) n.unique <- Nodes[!drop.index, ] w.unique <- numeric(length(n.unique[,1])) lw <- length(Weights) for (i in seq_along(w.unique)){

Re: [R] computing time for solve() in Matrix package

2012-06-28 Thread Paul Rathouz
Thank you for your response, Oliver. I think that the Matrix package has its own solve() functions that take advantage of the structure. If you make a block diagonal matrix, say, with kronecker() and do not impose any special structure on it. then, calling solve() will take very much longer

Re: [R] Storing results in a single file after looping over all files

2012-06-28 Thread Rui Barradas
Hello, You should post your data in a readable format. Use ?dput. Now, for your question, start by putting your results in a list. abcd <- read.table(text=" id ABCD 1 0.11 2-0.24 3 2.18 ", header=TRUE) efgh <- read.table(text=" id EFGH 1 -0.18 2 -1.33 3 0.88 ", head

Re: [R] Storing results in a single file after looping over all files

2012-06-28 Thread Jean V Adams
Without providing data and code that I can actually run and test, I can only take a guess at how to solve this. See my edits and suggestions in the code, below. Hope it helps. Jean Debs Majumdar wrote on 06/28/2012 12:49:40 AM: > Hi All, > > I have a whole lot of *.raw files in my working fo

[R] Help for string opeation

2012-06-28 Thread Takatsugu Kobayashi
Hi R users, I appreciate if you could give me some hint/help on this string operation. Suppose I have a list of string objects in varying sizes like [[1]] [1] "A" [2] "B" [3] "C" [[2]] [1] "D" [2] "E" [[3]] [1] "F" Then I would like to create a vector that contains all elements like [1] "A"

Re: [R] If statement - copying a factor variable to a new variable

2012-06-28 Thread peter dalgaard
On Jun 28, 2012, at 09:42 , Rui Barradas wrote: > Hello, > > Another way is to use index vectors: > > > v1.factor <- c("S","S","D","D","D",NA) > v2.factor <- c("D","D","S","S","S","S") > > td2 <- test.data <- data.frame(v1.factor,v2.factor) > > for (i in 1:nrow(test.data) ) { > >[... et

[R] would you give me your hand to standardize columns in a matrix?

2012-06-28 Thread Kristi Glover
Hi R User, Would you give me your hand to standardize some columns in a matrix? I have included the example table. > dput(test) structure(list(X = c(1, 2, 3, 4, 5, 6), Y = c(4, 5, 6, 7, 8, 9), temp = c(0.818, 0.113, 0.256, 0.587, 0.955, 0.207), oxy = c(0.797, 0.487, 0.727, 0.128, 0.514, 0.0

[R] Nested For Loop

2012-06-28 Thread arun.gurubaramurugeshan
I am creating a nested for loop and following are the codes I'm using, but I am not acheiving what I want. I have a vector d<-151:159 I have another vector e<-e<-c("apple", "orange", "banana") I need to create f as 151apple 151orange 151banana . . 159apple 159orange 159banana Here is how I w

[R] custom graphing of box and whisker plots

2012-06-28 Thread Brianna Wright
Hi, I'm trying to graph some data in a boxplot-like style, but I want to set the box and whisker limits myself (rather than having R calculate them for me). I'd like the boxes to be shaded and the whiskers to be dotted lines. My data are set up is something like this: min.whiskermax.whisker

Re: [R] Adjusting length of series

2012-06-28 Thread Lekgatlhamang, lexi Setlhare
Thanks a lot Peter. It is a learning process for me. From: Petr PIKAL Cc: R-Help Sent: Thursday, June 28, 2012 6:20 PM Subject: Re: [R] Adjusting length of series Hi I use R for quite a long time and as I remember I did not use such assign paste i loop

[R] Help

2012-06-28 Thread li li
Dear all, I need some help on plotting multiple boxplots on one figure. I have three matrix A, B and C. Each of them is a 1000 by 10 matrix. The 10 columns of all three matrix correspond to the 10 values of the same parameter, say k=1, ..., 10. I want to make a plot where x axis represents di

Re: [R] remove descriptions from output

2012-06-28 Thread Rolf Turner
On 28/06/12 22:24, Kathie wrote: Dear R users, I'd like to remove some descriptions when I use "filter". filter(1:10, rep(1, 3)) Time Series: Start = 1 End = 10 Frequency = 1 [1] NA 6 9 12 15 18 21 24 27 NA That is, I want only this [1] NA 6 9 12 15 18 21 24 27 NA Thank you in adv

Re: [R] Binary Quadratic Opt?

2012-06-28 Thread Petr Savicky
On Tue, Jun 26, 2012 at 11:52:15PM -0700, khris wrote: > Hi Petr, > > Appreciate your feedback and sorry for the delay in responding. The > following is the description of problem from start:- > > We have a set of sensors in XY plane arranged in more or less a rectangular > grid and we know thei

[R] assign object with loop (translation from SAS to R)

2012-06-28 Thread lynx
I have a dataset named DM with p1, p2, , p9 (9 columns, numerical values) I would like to calculate to multify each pair of columns (p1p2, p1p3,... p1p9, p2p3, p2p4 p8p9) and assign them in p1p2, p1p3,... p1p9, p2p3, p2p4 p8p9 In SAS, l=0; p_int_sum=0; do i=1 to 8; do j=(i

[R] SVY: variance inflation factor VIF with complex survey

2012-06-28 Thread Diana Marcela Martinez Ruiz
Hello, Seeking a way to get the variance inflation factor VIF for a model of regression in complex survey, I have understood that without this package (SURVEY) RGui VIF obtained as follows: fit <- lm(mpg~disp+hp+wt+drat, data=mtcars) vif(fit) But I want to kn

[R] Reading a new dataset using R

2012-06-28 Thread Prabeer Biswas
Dear Sir, We are able to read dataset in the syn.data (species:yeast) using R.But we want to read a new dataset using R. We are not able to do that please tell us the procedure of reading a new dataset of a new species. After reading the dataset we will use the minet for generating the MI matrix

[R] Merging listed dataset into one

2012-06-28 Thread Seungyeul Yoo
Hello, I'm wondering how I can merge two featuresets into one. My dataset is two sets of microarray data and it looks like followings: > rawData $v1 TilingFeatureSet (storageMode: lockedEnvironment) assayData: 2197815 features, 59 samples element names: channel1, channel2 protocolData rowN

Re: [R] Aggregate weights for a unique set of rows

2012-06-28 Thread Jean V Adams
You say "typical size of nodes --> 20x2" Do you mean that nodes has many many rows? Or many many columns? Or both? This is minimalist coding, but I'm not sure how fast it will run on your data aggregate(w, as.data.frame(nodes), sum) Jean "Weiser, Constantin" wrote on 06/28/2012

Re: [R] remove descriptions from output

2012-06-28 Thread Rolf Turner
On 28/06/12 22:31, Özgür Asar wrote: Dear Kathie, Try c(filter(1:10, rep(1, 3))) It is recommended that one should *not* use c() for its side effects. Better to use as.vector(). cheers, Rolf Turner __ R-help@r-project.org mailing l

Re: [R] Storing results in a single file after looping over all files

2012-06-28 Thread Debs Majumdar
Hi,   I can upload the toy datasets and code but am unsure about a good hosting site. Suggestions? I got the following error after the following command: out2 <- do.call(cbind, outs) Error in data.frame(..., check.names = FALSE) :   arguments imply differing number of rows: 0, 750 ### I ha

Re: [R] estimating parameters of a model

2012-06-28 Thread Özgür Asar
You can be sure that it is reliable! Ozgur -- View this message in context: http://r.789695.n4.nabble.com/estimating-parameters-of-a-model-tp4634808p4634811.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Simple mean trajectory (ordinal variable)

2012-06-28 Thread Eiko Fried
Hello. I have 5 measurement points, my dependent variable is ordinal (0 - 3), and I want to visualize my data. I'm pretty new to R. What I want is to find out whether people with different baseline covariates have different trajectories, so I want a plot with the means trajectory of my dependent v

Re: [R] package ‘rggobi’ is not available (for R version 2.15.0)

2012-06-28 Thread Prof Brian Ripley
On 28/06/2012 15:09, YTP wrote: I am having problems installing package rggobi. I have spent days reading other people's questions about this topic but could not get any useful info But not apparently the rw-FAQ, which would only take minutes. See the posting guide out of previous ans

Re: [R] Error: figure margins too large

2012-06-28 Thread David L Carlson
Well, you didn't tell us anything about your data, but plot() has to create space to draw ncol(mydataSNc)^2 plots. Depending on your graphics device, if you have more than about 45 columns in mydataSNc, you will hit the limit - although the plots will be illegible well before that. ---

Re: [R] Adjusting length of series

2012-06-28 Thread Petr PIKAL
Hi I use R for quite a long time and as I remember I did not use such assign paste i loop yet. Insted of such construct with polluting environment with plenty of objects named something(i)somethingelse it is always advisable to use lists. When you want to shorten variables to some common lengt

Re: [R] Printing a variable in a loop

2012-06-28 Thread Petr PIKAL
Hi > > Thanks for your reply Jon. > > I need to actually do more than print the name of the variable (I just made > the example simpler). I need to manipulate var_1, var_2 etc. but setting > values of NA to 0. Why? R has pretty strong system for handling NAs. The only exception AFAIK is cums

Re: [R] How can I make a list using aggregate function?

2012-06-28 Thread Rui Barradas
Hello, Your data is a mess, with more columns than column names. Use # 20 to 100 dput(head(comb.data, 30)) # paste the output of this in a post. Anyway, it seems that what you want is (untested) aggregate(zFEl~sequence, data=comb.data, quantile, probs=c(0.5,0.8,0.9), na.rm=T) Hope this hel

Re: [R] Printing a variable in a loop

2012-06-28 Thread Rui Barradas
Hello, Try the following. dd <- data.frame(A=letters[1:10], var_1=1:10, var_2=11:20) index <- grep("var_", names(dd)) for(i in index) print(dd[[ i ]]) # or dd[, i] # vars <- paste("var", 1:2, sep="_") for(v in vars) print(dd[, v]) # or dd[[ v ]] There's nothing you can do i

Re: [R] How can I make a list using aggregate function?

2012-06-28 Thread sureshraj
Hi freind, My data seems to be like , and data frame name is comb.data sequence weight rsat. zFEl 1CCTTGTT4.6 0.00058 -7.452 3.237 2ACTTTGAGGTG4.1 0.00077 -7.169 3.114 3GTCTTGAACTC4.8 0.00055 -7.506 3.260 4 GCTTTGAAGAA

Re: [R] plot.prcomp() call/eval

2012-06-28 Thread Joshua Wiley
On Thu, Jun 28, 2012 at 8:27 AM, Jessica Streicher wrote: > Thanks Josh, > > that soggy sandwhich saves me a LOT of code by the way, > I'll keep it  for the time being  ;) There may be other ways. With no knowledge of your context, obviously I cannot say absolutely that there are better ways to

[R] Adjusting length of series

2012-06-28 Thread Lekgatlhamang, lexi Setlhare
Dear R Users,   I ask the following question in order to learn more on the use of 'assign' and 'paste' functions and for loop; otherwise what I am asking could be solved by binding the various first differences of the series using the 'ts.union' operator.   The problem is: I have several varia

Re: [R] Printing a variable in a loop

2012-06-28 Thread kat_the_great
Hi Oliver, Thank you for your reply. I can't use vectors as each var_1, var_2 is a new column/variable, not a new observation within a vector. But thank you, Kat -- View this message in context: http://r.789695.n4.nabble.com/Printing-a-variable-in-a-loop-tp4634673p4634756.html Sent from the

Re: [R] Printing a variable in a loop

2012-06-28 Thread kat_the_great
Thanks for your reply Jon. I need to actually do more than print the name of the variable (I just made the example simpler). I need to manipulate var_1, var_2 etc. but setting values of NA to 0. So as you said, "1. if you want to "display" the variable, just type it >var_1 " But how do I do

Re: [R] qplot and colors (Please Help)

2012-06-28 Thread FJ M
colors <- c("red", "blue", "darkgreen", "gold", "black") labels <- c("3/02/2012","12/30/2011","4/20/2012") In plot I use { plot(x, hx1 , type="l", lwd=2, tck=1, col=colors[1], ylim=c(0, maxhx), xlab="x value", ylab="Density", main="AAPL") . . . labels, lwd=2, lty=c(1, 1, 1, 1, 2), col=colors)

[R] package ‘rggobi’ is not available (for R version 2.15.0)

2012-06-28 Thread YTP
I am having problems installing package rggobi. I have spent days reading other people's questions about this topic but could not get any useful info out of previous answers. I am running 32-bit Windows 7 and have successfully installed GGobi version 2.1.8. My error looks like this: > install.p

Re: [R] DCC-GARCH model

2012-06-28 Thread andy
Hello Marcin, did you get the answer to your questions. I have the same questions and would appreciate your help if you found the answers. Thanks, Ankur -- View this message in context: http://r.789695.n4.nabble.com/DCC-GARCH-model-tp3524387p4634776.html Sent from the R help mailing list archi

Re: [R] plot.prcomp() call/eval

2012-06-28 Thread Bert Gunter
Yes. One usually creates a call object when one need to modify it in some way -- e.g. alter arguments, change the function -- prior to evaluation. That doesn't seem to be the case here. Why isn't plot(pcal) acceptable? ?do.call is also a more straightforward way to create and evaluate a call i

Re: [R] plot.prcomp() call/eval

2012-06-28 Thread Jessica Streicher
Thanks Josh, that soggy sandwhich saves me a LOT of code by the way, I'll keep it for the time being ;) greetings Jessica On 28.06.2012, at 17:15, Joshua Wiley wrote: > Hi Jessica, > > x <- call("plot", quote(pcaI)) > eval(x) > > that said, I suspect you would be better off avoiding this id

Re: [R] Simulating web requests

2012-06-28 Thread Rui Barradas
Hello, Sorry if I've misread your original post. See answer inline Em 28-06-2012 05:15, Mohan Radhakrishnan escreveu: Not being the expert I have looked at papers like 'simpleR { Using R for Introductory Statistics' by John Verzani. Some sample Code is in these papers. Looks like I have to sea

Re: [R] plot.prcomp() call/eval

2012-06-28 Thread Joshua Wiley
Hi Jessica, x <- call("plot", quote(pcaI)) eval(x) that said, I suspect you would be better off avoiding this idiom altogether. Storing unevaluated calls is akin to putting tomatoes on your sandwich before packing it for work---you can do it but you end up with a soggy sandwich by the time you a

[R] plot.prcomp() call/eval

2012-06-28 Thread Jessica Streicher
Hi! I am getting a lot of numbers in the background of the pca screeplots if i use call("plot") and eval(somecall). Til now, creating the calls and plotting later on this way worked fine. Example: pcaI<-prcomp(iris[,1:4]) plot(pcaI) x<-call("plot",pcaI) eval(x) Anyone got an idea how i can

Re: [R] File Handling in R

2012-06-28 Thread R. Michael Weylandt
Take a look at scan and/or readLines Michael On Jun 28, 2012, at 9:02 AM, HIMANSHU MITTAL wrote: > Hello all, > I have a txt file with some data which isn't in any organized form like a > table, but just simple text. > Is there any way to read the file char by char and store the necessary > cha

Re: [R] Questions about doing analysis based on time

2012-06-28 Thread Rui Barradas
Hello, The only explanation I'm seeing is you are computing the SunScore averages using different datasets. With the dataset oyu've dput-ed I get your hand results. aggregate(SunScore ~ h, data=dat, mean) h SunScore 1 0 131.0167 2 1 107.7436 # Another way of doing the same sapply(split(dat

Re: [R] If statement - copying a factor variable to a new variable

2012-06-28 Thread Miguel Manese
On Thu, Jun 28, 2012 at 8:47 PM, James Holland wrote: > With the multiple if statements I need to check for, I though for statements > with the if/else if conditional statement was better than nested ifelse > functions. for () gives you a lot of flexibility at the expense of being verbose & slow,

Re: [R] formula version of sunflowerplot() fails when axis labelspecified

2012-06-28 Thread Gerrit Eichner
Thank you, Sina, thank you, David, I knew how to access the code of sunflowerplot.formula() and that sunflowerplot() does work in the default version, i.e., w/o formula (but your suggestions triggered my ambition ;-)). Below is my -- slightly commented -- version (the search for which was in

Re: [R] survfit function

2012-06-28 Thread Greg Snow
Try: survfit(Surv(Time, 1-Status)~1) On Wed, Jun 27, 2012 at 5:37 AM, niloo javan wrote: > > > Hello > > In (survfit(Surv(Time,Status)~1)) > > I want to have status=0 as Failure and status=1 as Censore. > > Changing above formula to (survfit(Surv(Time,Status)~0)) doesnot help!! > What should i do

Re: [R] loop through and modify multiple data frames

2012-06-28 Thread Tal Galili
Hi Jan, You can do it in two ways. The simplest one is the following. The first option is to use $. Here is how: dogs <- data.frame(a = 1:10, b = 10:1) dogs$c <- dogs$a+dogs$b dogs The second way it to use ?within Contact Details:--

Re: [R] Starting value problem for CG in optim()

2012-06-28 Thread John C Nash
I see at least 4 issues with trying this. 1) I am on record several times that CG was the LEAST SUCCESSFUL of the codes I put in my 1979 book and which is CG in optim(). 2) Rcgmin is better (I implemented this, but the method is Yuan/Dai), and there may be other CG codes that can squeeze a bit

Re: [R] Making a Subset Assignment function ("[<-")

2012-06-28 Thread Prof Brian Ripley
On 28/06/2012 10:39, dj hawthorne wrote: Greetings, I am trying to understand how to making a subset assignment function. Take the example where of making a "last" generic function. last <- function(x,...) UseMethod("last"); last.numeric <- function(x, ...) x[length(x)] last.list <- functio

[R] File Handling in R

2012-06-28 Thread HIMANSHU MITTAL
Hello all, I have a txt file with some data which isn't in any organized form like a table, but just simple text. Is there any way to read the file char by char and store the necessary characters? Regards, Himanshu Mittal [[alternative HTML version deleted]] _

Re: [R] Error: could not find function

2012-06-28 Thread Jeff Newmiller
Workspaces do not store loaded packages. It is necessary to re-execute the library functions for each session, even if you re-load the workspace. Also, environment variables defined within R must be redefined using the same R Sys.setenv() function calls as originally used. This is why keeping a

Re: [R] Mystery!!!

2012-06-28 Thread Bob O'Hara
I think the big mystery is how you got hold of R 15.1.0. :-) (sorry, couldn't resist. Presumably you mean R2.15.x) More seriously, I thinkwe would need to be told more, e.g. what are a, b, and c? My guess is that you either have x or y defined already, so check to see if they exist at the point i

Re: [R] qplot and colors (Please Help)

2012-06-28 Thread John Kane
Something like this may do it. http://stackoverflow.com/questions/6919025/how-to-assign-colors-to-categorical-variables-in-ggplot2-that-have-stable-mappin John Kane Kingston ON Canada > -Original Message- > From: david_ly...@yahoo.com > Sent: Wed, 27 Jun 2012 09:07:53 -0700 (PDT) > To:

[R] undefined S4 class in parallel computing at snowfall

2012-06-28 Thread Edwin Sun
Dear All, I have a question of how to export S4 class specification to clusters/workers in parallel computing. The package I used is snowfall. The problem is reproducible as follows. Any hint is greatly appreciated. Edwin Sun === begin === library(snowfall) sfInit(parallel = TRUE, cpus =

[R] Mystery!!!

2012-06-28 Thread arun.gurubaramurugeshan
I am executing the following loops in R 15.1.0 and the first one works and produces results. However, the second one is not with initiating the object as x[i]. Further, I was able to get the second loop work in R 15.0. Am I missing something here? for(i in 1:length(b)) {y[i]<-paste(a,b[i],c,sep=""

Re: [R] How can I make a list using aggregate function?

2012-06-28 Thread John Kane
data? We really should see some sample data. See ?dput for a way to supply some. John Kane Kingston ON Canada > -Original Message- > From: sureshmallika...@gmail.com > Sent: Thu, 28 Jun 2012 01:58:30 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] How can I make a list using agg

Re: [R] remove descriptions from output

2012-06-28 Thread arun
Hi, You could also use rollapply () from zoo library(zoo)  t2<-as.numeric(rollapply(1:10,3,sum)) [1]  6  9 12 15 18 21 24 27 t1<-c(filter(1:10, rep(1, 3))) t1<-t1[!is.na(t1)]  identical(t1,t2) [1] TRUE A.K. - Original Message - From: Özgür Asar To: r-help@r-project.org Cc: Sent: Th

[R] Fw: Extract upper case letters

2012-06-28 Thread arun
- Forwarded Message - From: arun To: mdvaan Cc: R help Sent: Thursday, June 28, 2012 1:44 AM Subject: Re: [R] Extract upper case letters Hi, Try this: t <- "TheWeatherIsVeryNice"  t1<-gsub("[:A-Z:]","",t)  t1 [1] "heeatherseryice" t2<-gsub("[:a-z:]","",t) > t2 [1] "TWIVN" A.K.

Re: [R] Strating value problem for CG in optim()

2012-06-28 Thread Ruben
Hi, It isn't surprising that convergence results depend on initial par values in a nonlinear optimization problem. There might be local maxima in the landscape defined by your likelihood function and you have to explore it for the proper starting places. One suggestion is to try many differe

[R] How can I make a list using aggregate function?

2012-06-28 Thread sureshraj
Hi friends, I need to generate a list, that should contain the quantile value of one column in a data frame. while I am compiling this one i am facing one bug,, Really I cannot find out that where the problem has occurred? Could any one help me to come out from this bug?? Here is the code,

Re: [R] Questions about doing analysis based on time

2012-06-28 Thread APOCooter
That is very helpful, and exactly what I was looking for! However, I seem to have some problems. When I ran the following line: aggregate(SunScore ~ h, data=dat, mean) I got the following output: h SunScore 1 0 136.01389 2 1 135.27632 3 2 127.03704 4 3 127.17105 5 4 129.94545 6

[R] loop through and modify multiple data frames

2012-06-28 Thread Jan Näs
Hi Newbie question: I have a set of data frames that I want to do the same calculations on each. I've found out that I can put them in a list and loop through the list to do the calculation, but not put the results back into each data.frame.. For example three data frames cats, dogs, birds wher

[R] remove descriptions from output

2012-06-28 Thread Kathie
Dear R users, I'd like to remove some descriptions when I use "filter". > filter(1:10, rep(1, 3)) Time Series: Start = 1 End = 10 Frequency = 1 [1] NA 6 9 12 15 18 21 24 27 NA That is, I want only this [1] NA 6 9 12 15 18 21 24 27 NA Thank you in advance. Kathie -- View this messa

[R] Making a Subset Assignment function ("[<-")

2012-06-28 Thread dj hawthorne
Greetings, I am trying to understand how to making a subset assignment function. Take the example where of making a "last" generic function. last <- function(x,...) UseMethod("last"); last.numeric <- function(x, ...) x[length(x)] last.list <- function(x, ...) x[[length(x)]] . Now we run

Re: [R] If statement - copying a factor variable to a new variable

2012-06-28 Thread James Holland
Yeah, the reason I didn't use ifelse is because I've got multiple variables to manipulate based on the if statement, some factors and some numeric. I have to look at the factor variables, and based on that, either use one series of variables or another. With the multiple if statements I need to c

[R] How to calculate Confidence Interval for a prediction using Partial Regression?

2012-06-28 Thread Dani Díaz de Quijano
Dear all, I have two highly correlated variables (y and x), and both of them depend on a third variable (A, for Area). Multiple regression (y=a+(b*x)+(c*A)) would have collinearity problems, so I decided to do a partial regression to predict y. I did it this way: - I regressed y to A, and calcu

[R] Aggregate weights for a unique set of rows

2012-06-28 Thread Weiser, Constantin
Hi, all together. I have - a maybe trivial - problem with aggregating a list of weights. Here is the problem: - At first I have set of nodes (X/Y-coordinates) and associated weights, where the set of nodes is typically not unique - I want to get a set of unique nodes and the sum of associated

[R] Indifference curve

2012-06-28 Thread Akhil dua
Hello everyone I am new to R I need to plot 3 indifference curve for the level 100, 200 and 300 my utility function is of the form u(x,y)=3x^2+2y I also need to draw contour line on it can any one please tell me how to do it [[alternative HTML version deleted]] ___

Re: [R] add constraints to nls or use another function

2012-06-28 Thread Ben Bolker
PtitBleu yahoo.fr> writes: > > Hello, > > I'm trying to fit experimental data with a model and nls. > For some experiments, I have data with x from 0 to 1.2 and the fit is quite > good. > But it can happen that I have data only the [0,0.8] range (see the example > below) and, then, the fit is

Re: [R] trend in incidence rate

2012-06-28 Thread Marc Schwartz
On Jun 27, 2012, at 3:11 AM, ericlsh wrote: > I would like to compare the incidence rates of three groups. They are > supposed to have different risks so I would like to test whether there is a > increasing trend in the incidence rates. Does R or any packages provide a > trend test for incidence r

[R] OT: Any reason why one of my computers is so slow?

2012-06-28 Thread Bos, Roger
This is not a criticism of R, but R runs much slower on one of my machines than it does on the others, so something is wrong with that machine, but I don't know where to look for a remedy. Here are the details: I have a 32-bit win xp machine running at 2.66Ghz and a 64-bit win 7 machine runnin

Re: [R] Help with spdep package issue with errorsarlm

2012-06-28 Thread Roger Bivand
Samantha Sifleet epamail.epa.gov> writes: > > >Hi List, >I am hoping some of you have experience with the spdep package. >I have had success with lm.morantest and lm.LMtests. >I am trying to run a spatial error model and I keep getting the following >error >Error in res[

Re: [R] Error: could not find function

2012-06-28 Thread Özgür Asar
How do I load the package again (install it from server again?) library(omega) there a way to check which workspace was used in history? Unless you do not save it, you will use a fresh one. Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Error-could-not-find-function-tp

Re: [R] Error: could not find function

2012-06-28 Thread Pascal Oettli
Hello, To load the package: > library(name_of_package) Regards Le 12/06/28 20:02, codec cat a écrit : I was using omega function How do I load the package again (install it from server again?) and is there a way to check which workspace was used in history? On 28 June 2012 10:45, Pascal

Re: [R] Error: could not find function

2012-06-28 Thread codec cat
I was using omega function How do I load the package again (install it from server again?) and is there a way to check which workspace was used in history? On 28 June 2012 10:45, Pascal Oettli wrote: > Hello, > > Which function? > > Regards > > Le 12/06/28 18:29, codec cat a écrit : > >> Hi >

Re: [R] decomposing a single intact vector

2012-06-28 Thread Rui Barradas
Hello, Try x <- "(O, O, O, H, L, O, O, O, O)" strsplit(gsub("\\(|\\)|[[:blank:]]", "", x), ",") Note that the result is a list, not a vector. You can then use `[[` or unlist(). Hope this helps, Rui Barradas Em 28-06-2012 11:42, Jessy escreveu: Dear all, I have a vector of length 1 but

Re: [R] MuMIn Problem getting adjusted Confidence intervals

2012-06-28 Thread Kamil Bartoń
summary(model.avg(...)) gives much more information. pozdrowienia, kamil Dnia 2012-06-28 12:00, KKulma pisze: Message: 60 From: KKulma To:r-help@r-project.org Subject: Re: [R] MuMIn Problem getting adjusted Confidence intervals Hello, I seem to be having a similar problem, but with glmer mode

Re: [R] decomposing a single intact vector

2012-06-28 Thread Sarah Goslee
You can use gsub() to eliminate the parentheses, and strsplit() to separate the elements. Sarah On Thursday, June 28, 2012, Jessy wrote: > Dear all, > > I have a vector of length 1 but within this vector there are 9 elements > > vectorNOcorrection > [1] "(O, O, O, H, L, O, O, O, O)" > can someon

[R] decomposing a single intact vector

2012-06-28 Thread Jessy
Dear all, I have a vector of length 1 but within this vector there are 9 elements > vectorNOcorrection [1] "(O, O, O, H, L, O, O, O, O)" can someone help me with how I can have it as with 9 element separated such that it will have length 9 as "O", "O"," O", "H","L", "O", "O", "O", "O" Kind rega

Re: [R] Make a reference?

2012-06-28 Thread Sarah Goslee
Hi, I don't see how this is an R question. You add references in whatever way is appropriate for your word processor or document preparation method and your bibliographic software. R is neither of those things, though citation() is rather underused. Sarah On Wednesday, June 27, 2012, quantum wro

Re: [R] R help, using R to build choropleth

2012-06-28 Thread Jim Lemon
On 06/28/2012 03:26 PM, iverson wrote: Hi guys i need some help to build choropleth. Basically i am trying to colour regions on the map by population. I possess the shape file of the country, and also the population data, however, i am having trouble to create the plot, below is my code: po

Re: [R] Size of subsample in ecodist mantel()

2012-06-28 Thread Sarah Goslee
You can set it using the pboot argument. Sarah On Thursday, June 28, 2012, nevil amos wrote: > What is the size of the boostrapped subsample in ecodist mantel() > > thanks > >[[alternative HTML version deleted]] > > __ > R-help@r-project.org

Re: [R] remove descriptions from output

2012-06-28 Thread Özgür Asar
Dear Kathie, Try c(filter(1:10, rep(1, 3))) Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/remove-descriptions-from-output-tp4634723p4634727.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-proje

Re: [R] Error: could not find function

2012-06-28 Thread Özgür Asar
Dear codec cat, Once you installed an R package, you do not have to install it again. But, you have to load the package when you change your workspace. Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Error-could-not-find-function-tp4634716p4634726.html Sent from the R

Re: [R] Printing a variable in a loop

2012-06-28 Thread Oliver Ruebenacker
Hello, Can't you just use vectors? Untested example: var[1] <- 10 var[2] <- 20 y <- 1 while(y < 3) { print(var[y]) y <- y+1 } Take care Oliver On Wed, Jun 27, 2012 at 8:22 PM, kat_the_great wrote: > Dear R Users: > > I'm a STATA user converting to R, and I'd

Re: [R] Feature request: 'file.path()' accepting an input vector

2012-06-28 Thread Janko Thyson
Clearly you're right - and polite... as always I asked the question because I wanted to avoid 'paste(x, collapse="/")' and 'do.call(file.path, as.list(x))' because it's less efficient than 'file.path()' and '?file.path()' explicitly recommends *not* using 'paste()' for putting together file pa

Re: [R] Feature request: 'file.path()' accepting an input vector

2012-06-28 Thread Prof Brian Ripley
On 28/06/2012 10:40, Janko Thyson wrote: Dear list, I have a small feature request regarding the implementation of 'file.path()': Clearly you have not read where and how to make feature requests (R-devel list or Wishlist on bugs.r-project.org). It'd be great if 'file.path()' would allow to

[R] Strating value problem for CG in optim()

2012-06-28 Thread nataraj
Dear list-members, I have done optimization of 3 parameters by maximum likelihood method using conjugate gradient as optimizer. Since I have the reported value of the parameters from an article, I can validate the result of the optimized parameters. The problem is that optimizer converges to t

Re: [R] Error: could not find function

2012-06-28 Thread Pascal Oettli
Hello, Which function? Regards Le 12/06/28 18:29, codec cat a écrit : Hi Do I have to load/download the whole package over and over again everytime when I use the R-Project? It often prompt me the error message "could not find function"- but I'm rather sure I have used the function before so

[R] Feature request: 'file.path()' accepting an input vector

2012-06-28 Thread Janko Thyson
Dear list, I have a small feature request regarding the implementation of 'file.path()': It'd be great if 'file.path()' would allow to specify an input *vector* instead of solely rely on a specification via the three dot argument. AFAIU, currently it's only possible to "manually" specify ea

  1   2   >