Re: [R] A solution for question about formatting Dates

2012-06-28 Thread Patrick Connolly
On Tue, 26-Jun-2012 at 11:57PM -0500, Erin Hodgess wrote: | Hello again: | | Here is a solution to the dates without leading zeros: | | pou1 - function(x) { | #Note: x is a data frame | #Assume that Column 1 has the date | #Column 2 has station | #Column 3 has min |

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

2012-06-28 Thread Debs Majumdar
Hi All, I have a whole lot of *.raw files in my working folder and I am doing the same analysis on each of those and want to save all the results in a single file. I am making some mistake here and can't figure out how to solve it. Say, the *.raw files are ABCD.raw, EFGH.raw, IJKL.raw ...

[R] R help, using R to build choropleth

2012-06-28 Thread iverson
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: population=read.csv(nz2.csv) population

Re: [R] A solution for question about formatting Dates

2012-06-28 Thread Patrick Connolly
On Thu, 28-Jun-2012 at 06:27PM +1200, Patrick Connolly wrote: | On Tue, 26-Jun-2012 at 11:57PM -0500, Erin Hodgess wrote: | | | Hello again: | | | | Here is a solution to the dates without leading zeros: | | [...] | | | This is not particularly elegant, but it does the trick. | | It's also

Re: [R] Printing a variable in a loop

2012-06-28 Thread Miguel Manese
Hi Kat, On Thu, Jun 28, 2012 at 8:22 AM, kat_the_great k...@hotmail.com wrote: Dear R Users: I'm a STATA user converting to R, and I'd like to be to do the following. #Assign var_1 and var_2 a value 10-var1 20-var2 #Now I'd like to print the values of var_1 and var_2 by looping through

Re: [R] building binary tree

2012-06-28 Thread steven mosher
I believe chambers book has an example using S4 classes. which isnt much help for a beginner. you can do it the old school way. build it by hand with one vector of pointers and another data structure of leaf nodes. there is nothing magical about a tree. you can build one in basic or fortran.

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

2012-06-28 Thread Pascal Oettli
Hello, You can find some hints there: http://geography.uoregon.edu/geogr/topics/index.html Regards Le 12/06/28 14:26, iverson a écrit : 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,

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

2012-06-28 Thread Miguel Manese
Hi James, On Thu, Jun 28, 2012 at 12:33 AM, James Holland holland.ag...@gmail.com wrote: I need to look through a dataset with two factor variables, and depending on certain criteria, create a new variable containing the data from one of those other variables. The problem is, R keeps making

Re: [R] Extract upper case letters

2012-06-28 Thread Rui Barradas
Hello, Try the following. txt - TheWeatherIsVeryNice Up - strsplit(txt, [[:lower:]]*) Up[Up != ] Hope this helps, Rui Barradas Em 27-06-2012 20:15, mdvaan escreveu: t - TheWeatherIsVeryNice How do I extract the upper case letters? - TWIVN Thanks! -- View this message in context:

[R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Zhipeng Wang
Hello all, When I wanted to use package foreach, I got the Error. That is: library(foreach) Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 Error: package/namespace load failed for ‘foreach’ I am using R-2.14.2, 64 bit. Even I reinstalled R and package foreach, the

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

2012-06-28 Thread Rui Barradas
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) ) { [... etc ...] } #End FOR # Create index vectors na1 - is.na(v1.factor) na2 - is.na(v2.factor) # Create

Re: [R] Running R on a cluster

2012-06-28 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27/06/12 22:02, Xuefeng Gao wrote: Hello, I have R script my_script.R . It loads a large input file data.txt and then outputs a large matrix out. (the command of running it on cluster using my.cmd is put at the end) You will get much more

Re: [R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Pascal Oettli
Hello, Did you try by upgrading your version of R? Regards Le 12/06/28 16:27, Zhipeng Wang a écrit : Hello all, When I wanted to use package foreach, I got the Error. That is: library(foreach) Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 Error:

Re: [R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Zhipeng Wang
Dear Oettli, I installed three ver R in my machine, 2.14.2, 2.15.0 and 2.15.1. foreach could be called in the latter 2, though in 2.15.0, there is a warning message: package ‘foreach’ was built under R version 2.15.1 . Maybe it is OK to just use R 2.15.1, but at present I have problem to use R

Re: [R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Pascal Oettli
Hello, I use neither Eclipse nor StatET. Thus, I can't help you further. Good luck Regards Le 12/06/28 17:14, Zhipeng Wang a écrit : Dear Oettli, I installed three ver R in my machine, 2.14.2, 2.15.0 and 2.15.1. foreach could be called in the latter 2, though in 2.15.0, there is a warning

[R] Size of subsample in ecodist mantel()

2012-06-28 Thread nevil amos
What is the size of the boostrapped subsample in ecodist mantel() thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] add constraints to nls or use another function

2012-06-28 Thread PtitBleu
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 not correct. I would like to add a

Re: [R] Replacing sets of rows in matrix within a loop

2012-06-28 Thread Rui Barradas
Hello, You are replacing the values of runif each time through the loop. And it's not just that, every time through, you are setting outcome[, 1] and outcome[, 2] to the same values. Simply put, the loop is not needed. Corrected: n - 100 ## patients per trial trials - 3 ## 3 trials med -

Re: [R] rrdf package for mac not working

2012-06-28 Thread Ricardo Pietrobon
Uwe, sorry for the HTML. In answer to your post: I did try to contact the developer, no response. but a colleague pointed me to a way out yesterday through the RCurl and XML packages: library(RCurl) library(XML) endpoint - http://qcrumb.com/sparql; query - PREFIX sdmx-measure:

Re: [R] Filling In Grid based on 0 and 1

2012-06-28 Thread Rui Barradas
Hello, This seems simple: # 100 Bernoulli trials x - sample(c(0,1), 100, replace = TRUE) image(1:10, 1:10, matrix(x, 10), col=0:1) Hope this helps, Rui Barradas Em 27-06-2012 17:06, vp726 escreveu: Hi, I'm wondering if I can do this in R. I have a data set with questions (x-value) and

[R] Error: could not find function

2012-06-28 Thread codec cat
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 I'm not entirely sure it couldn't find it again when I shut down the

Re: [R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Prof Brian Ripley
On 28/06/2012 08:27, Zhipeng Wang wrote: Hello all, When I wanted to use package foreach, I got the Error. That is: library(foreach) Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 Error: package/namespace load failed for ‘foreach’ I am using R-2.14.2, 64 bit.

[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

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] 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

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

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

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 k...@hotmail.com wrote: Dear R Users: I'm a STATA user converting to R,

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

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. __

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] 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:

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

[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 regards, Jessy

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 someone help

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, KKulmakatarzyna.ku...@ebc.uu.se pisze: Message: 60 From: KKulmakatarzyna.ku...@ebc.uu.se To:r-help@r-project.org Subject: Re: [R] MuMIn Problem getting adjusted Confidence intervals Hello, I seem

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 within

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 kri...@ymail.com wrote: Hello, Which function? Regards Le 12/06/28 18:29, codec cat a écrit :

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 Ö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:

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

2012-06-28 Thread Roger Bivand
Samantha Sifleet Sifleet.Samantha at 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

[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

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

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

2012-06-28 Thread Ben Bolker
PtitBleu ptit_bleu at 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

[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]]

[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

[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

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

[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 message

[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 into

[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

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] 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] 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

[R] Fw: Extract upper case letters

2012-06-28 Thread arun
- Forwarded Message - From: arun smartpink...@yahoo.com To: mdvaan mathijsdev...@gmail.com Cc: R help r-help@r-project.org 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]

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 oa...@metu.edu.tr To:

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

[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] 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:

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

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

[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] 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 - function(x,

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] 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

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 niloo_ja...@yahoo.com 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

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

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 holland.ag...@gmail.com 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

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

Re: [R] File Handling in R

2012-06-28 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at scan and/or readLines Michael On Jun 28, 2012, at 9:02 AM, HIMANSHU MITTAL hm3...@gmail.com 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

[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] 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 are

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

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 idiom

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

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

[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:

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) } It looks like qplot

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 this

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

[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

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

2012-06-28 Thread Joshua Wiley
On Thu, Jun 28, 2012 at 8:27 AM, Jessica Streicher j.streic...@micromata.de 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

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] 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 in Stata

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

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 cumsum

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

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] 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

[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

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