Re: [R] how to use Excel VBA's Shell() to call and execute R file

2010-04-19 Thread Guy Green
Hi KZ, I don't think that I can answer what I think is the precise question - how to run the R file from VBA but without using RExcel. However with RExcel installed, I have found it very straightforward to run R code from within VBA (thanks Erich Neuwirth - RExcel is great). The VBA code is:

[R] how to use Excel VBA's Shell() to call and execute R file

2010-04-18 Thread KZ
I have an R file R_test.R saved in C:\R_test folder. The R_test.R looks like this: setwd(C:/R_test) rnorm(100) write(rnorm(100),data.txt) q(save=no, runLast = F) Next I would like use an Excel VBA/macro Shell() function to call R and execute R_test.R file. The syntax is

[R] how to use the neural networks package for time series prediction

2010-04-16 Thread david sabine
Hello all , Does any one know how to use the neural networks package for time series prediction ? Have you a similar example in R language ? thanks in advance David [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] How to use tapply for quantile

2010-04-09 Thread Patrick Hausmann
Hi James, I don't know how to solve it with tapply (something with split I think..), but you could use plyr (from Hadley Wickham). library(plyr) # Generate some data set.seed(321) myD - data.frame( Place = sample(c(AWQ,DFR, WEQ), 10, replace=T), Light = sample(LETTERS[1:2], 15,

Re: [R] How to use tapply for quantile

2010-04-09 Thread Charles C. Berry
On Thu, 8 Apr 2010, James Rome wrote: I am trying to calculate quantiles of a data frame column split up by two factors: # Calculate the quantiles quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile, na.rm = TRUE) This does not work: It seems like it did work. It returned a

[R] How to use tapply for quantile

2010-04-08 Thread James Rome
I am trying to calculate quantiles of a data frame column split up by two factors: # Calculate the quantiles quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile, na.rm = TRUE) This does not work: quarts 04L 04R 15R 22L 22R 2732 33L

Re: [R] How to use the paste function to create an already used variable

2010-03-25 Thread Biedermann, Jürgen
Thank you very much for the solutions! :-) It's my fault, but I forgot to mention that at the end of the loop, I would like to give Data back to data1, data2, data3, data4 The eval formula only seems to work in one direction (it's the same with the get function) for (i in 1:4) {

Re: [R] How to use the paste function to create an already used variable

2010-03-25 Thread Biedermann, Jürgen
Perfekt! So, the code below does, what I want it does. for (m in 1:AnzRat) { Daten_akt - eval(parse(text=paste(Daten,m,_akt,sep=))) ... ... assign(paste(Daten,m,_akt,sep=),Daten_akt) } Patrick Burns schrieb: I think you are looking for 'assign'. On 25/03/2010 09:40,

Re: [R] How to use the paste function to create an already used variable

2010-03-25 Thread Sharpie
quot;Biedermann, Jürgenquot; wrote: Perfekt! So, the code below does, what I want it does. for (m in 1:AnzRat) { Daten_akt - eval(parse(text=paste(Daten,m,_akt,sep=))) ... ... assign(paste(Daten,m,_akt,sep=),Daten_akt) } You may want to consider replacing

[R] How to use the paste function to create an already used variable

2010-03-24 Thread Biedermann, Jürgen
Hi there, I have the following problem Four data frames exist: data1 data2 data3 data4 Now I want to write a loop and temporarily store the data1, data2, data3, data4 in a variable called data. I tried the following... for (i in 1:4) { Data - paste(data,i,sep=) ... .. } but it doesn't

Re: [R] How to use the paste function to create an already used variable

2010-03-24 Thread Tal Galili
Try: for (i in 1:4) { Data - eval(parse(text = paste(data,i,sep=))) ... .. } (and if there are other solutions - I would love to know) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me:

Re: [R] How to use the paste function to create an already used variable

2010-03-24 Thread David Winsemius
On Mar 24, 2010, at 9:25 AM, Tal Galili wrote: Try: for (i in 1:4) { Data - eval(parse(text = paste(data,i,sep=))) ... .. } (and if there are other solutions - I would love to know) Well, it's not actually a solution since the first three fetched values would have been overwritten.

Re: [R] How to use the paste function to create an already used variable

2010-03-24 Thread Duncan Murdoch
On 24/03/2010 9:25 AM, Tal Galili wrote: Try: for (i in 1:4) { Data - eval(parse(text = paste(data,i,sep=))) ... .. } (and if there are other solutions - I would love to know) The get() function is simpler if you're just retrieving a variable: Data - get(paste(data, i, sep=)) Duncan

Re: [R] How to use the paste function to create an already used variable

2010-03-24 Thread Henrique Dallazuanna
Try this: Data - lapply(ls(pattern = 'data[0-9]'), get) Data[[1]] is data1 Data[[2]] is data2 etc. 2010/3/24 Biedermann, Jürgen juergen.biederm...@charite.de: Hi there, I have the following problem Four data frames exist: data1 data2 data3 data4 Now I want to write a loop and

[R] how to use node info generated by rpart in mars?

2010-03-23 Thread vibha patel
I am working on rpart, mars and earth. they all work fine individually. but i want to use node information generated by rpart in earth or mars. (mars is sensitive to outliers. CART deals effectively with outliers.) is there any way to perform this? Thanks. [[alternative HTML version

[R] how to use node info generated by rpart in mars?

2010-03-23 Thread vibha patel
I am working on rpart, mars and earth. they all work fine individually. but i want to use node information generated by rpart in earth or mars. (mars is sensitive to outliers. CART deals effectively with outliers.) is there any way to perform this? Thanks. [[alternative HTML version

[R] How to use ifelse to generate random value from a distribution

2010-03-17 Thread alex46015
I need use different parameters of distribution for different case to generate random value, but I use ifelse, the generated value is fixed without change. Here is example data1 y x 1 1 2 2 2 1 3 3 2 4 4 3 5 5 3 6 6 1 7 7 2 8 8 1 9 9 1 10 10 3 11 11 3 12 12 2

Re: [R] How to use ifelse to generate random value from a distribution

2010-03-17 Thread alex46015
I think I figure it out. ifelse(data1$x==1,rnorm(12,2,1),ifelse(data1$x==2,rnorm(12,-2,1),rnorm(12,110,1))) Please correct me if I am wrong. Thanks -- View this message in context: http://n4.nabble.com/How-to-use-ifelse-to-generate-random-value-from-a-distribution-tp1597064p1597102.html

Re: [R] How to use ifelse to generate random value from a distribution

2010-03-17 Thread Erik Iverson
alex46015 wrote: I think I figure it out. ifelse(data1$x==1,rnorm(12,2,1),ifelse(data1$x==2,rnorm(12,-2,1),rnorm(12,110,1))) Where is the number 12 coming from? Is that the length of data1$x? Here is a sample using the fact that rnorm can accept vectors of means and sds. My x is

Re: [R] How to use ifelse to generate random value from a distribution

2010-03-17 Thread alex46015
Thanks for all you guys'  help above.   Actually my question is for Multivariate Normal   m1-c(2.5,3.5,4.5) m2-c(-3,-4,-5) m3-c(100,120,130) n1-length(data$x) sigma1-matrix(c(1,0.3,0.4,0.3,1,0.2,0.4,0.2,1),nrow=3,byrow=T)  

[R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
I would like to be able to use two functions; qansari and pansari which are found in the function ansari.test. How can I evaluate these functions independently? Thanks. --Dale For example, when I load the function ... qansari - function(p, m, n) { .C(R_qansari,

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Sharpie
Dale Steele wrote: I would like to be able to use two functions; qansari and pansari which are found in the function ansari.test. How can I evaluate these functions independently? Thanks. --Dale For example, when I load the function ... qansari - function(p, m, n) {

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Sharpie
Dale Steele wrote: methods(ansari.test) stats:::ansari.test.default the two functions that are part of ansari.test.default: qansari - function(p, m, n) { .C(R_qansari, as.integer(length(p)), q = as.double(p), as.integer(m), as.integer(n))$q

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
Thanks, when I modify the function as I think you suggest, I get the following error: qansari - function(p, m, n) { .C(R_qansari, as.integer(length(p)), q = as.double(p), as.integer(m), as.integer(n))$q } qansari( 0.025, 5, 5) Error in

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread hadley wickham
Try: stats:::R_pansari Hadley On Wed, Feb 24, 2010 at 7:55 PM, Dale Steele dale.w.ste...@gmail.com wrote: Thanks, when I modify the function as I think you suggest, I get the following error: qansari  - function(p, m, n) {                .C(R_qansari, as.integer(length(p)), q =

[R] How to use same function for diffrent input values

2010-02-19 Thread Madhavi Bhave
Dear R helpers   I have written some function (the actual code I have pasted at the end of mail) like say   indiv_rate = function(n, rate_name, rate, rate_rf1, rate_rf2, rate_rf3, rateprob1, rateprob2, rateprob3) { some R commands   return(data.frame(rate_name, rates = round(rate_data,

Re: [R] How to use same function for diffrent input values

2010-02-19 Thread Barry Rowlingson
On Fri, Feb 19, 2010 at 8:20 AM, Madhavi Bhave madhavi_bh...@yahoo.com wrote: rates = indiv_rate(n = read.csv('number.csv')$n, rate_name = read.csv('rate.csv')$rate_name, rate = read.csv('rate.csv')$rate, rate_rf1 = read.csv('rate_rf.csv')$rate_rf1, rate_rf2 =

[R] How to use a string to refer a function?

2010-02-11 Thread blue sky
f=function(){ print('in f')} attr(f, 'source') [1] function(){ print('in f')} I have the above simple function. I can use the variable f to refer to the function and get the function source. Suppose that I have 'f' as a string (say I get it from ls()), could somebody let me know how to get the

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Erik Iverson
Hint: somebody let me know how to get the function from the name 'f'? __ R-help@r-project.org 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

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Gabor Grothendieck
See the FAQ for your question. In addition make sure you read about the keep.source option on the ?options page to find out the situation in which attr(f, source) will or will not work. On Thu, Feb 11, 2010 at 5:26 PM, blue sky bluesky...@gmail.com wrote: f=function(){ print('in f')} attr(f,

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Don MacQueen
Don't really understand what you have in mind, but maybe this will do it. f - function(x=3) x^2 Now, if I want to get the function f, given that I only know its name f, I can do this: getf - get('f') getf(4) Or even: get('f')(5) [1] 25 Also, attributes(getf) $source [1]

[R] how to use optim() or nlm() to solve three nonlinear equations

2010-02-02 Thread Nai-Wei Chen
Dear all, I just know how to solve an eaquation by using optim() or nlm(). But, now, I have three nonlinear equations, how could we use optim() or nlm() to solve  a system of nonlinear equations in R?  Thank you so much. Sincerely, Joe ___

Re: [R] how to use optim() or nlm() to solve three nonlinear equations

2010-02-02 Thread Berend Hasselman
Nai-Wei Chen wrote: I just know how to solve an eaquation by using optim() or nlm(). But, now, I have three nonlinear equations, how could we use optim() or nlm() to solve  a system of nonlinear equations in R?  Thank you so much. You don't use general optimize routines to solve a

[R] How to use escape characters in a string

2010-01-29 Thread mary guo
Hi, I want to use a character as below in R, as.character(`X^`R\`S) [1] `X^`R`S Warning messages: 1: '\`' is an unrecognized escape in a character string 2: unrecognized escape removed from `X^`R\`S But I found errors. Can I use some option in as.character() to change this? Thanks Mary

Re: [R] How to use escape characters in a string

2010-01-29 Thread Bert Gunter
: Friday, January 29, 2010 1:58 PM To: r-help@r-project.org Subject: [R] How to use escape characters in a string Hi, I want to use a character as below in R, as.character(`X^`R\`S) [1] `X^`R`S Warning messages: 1: '\`' is an unrecognized escape in a character string 2: unrecognized escape removed

Re: [R] How to use escape characters in a string

2010-01-29 Thread David Winsemius
On Jan 29, 2010, at 4:58 PM, mary guo wrote: Hi, I want to use a character as below in R, What character? as.character(`X^`R\`S) [1] `X^`R`S Warning messages: 1: '\`' is an unrecognized escape in a character string 2: unrecognized escape removed from `X^`R\`S nchar(`X^`R\`S) [1] 7

Re: [R] How to use read.table with Hebrew column names ?

2010-01-04 Thread Tal Galili
Hi David, Jorge and everyone else. I tried loading the file (with the Hebrew columns) on two machines. On one of them if loaded fine, and on the other it didn't. I also see a difference with the sessionInfo() of the two machines. You're advice would be most welcomed. On both machines I tried the

Re: [R] How to use read.table with Hebrew column names ?

2010-01-02 Thread Tal Galili
Hi David, Thank you for responding, but it didn't work. I get the following error: [1] X. 0 rows (or 0-length row.names) Warning messages: 1: In read.table(http://www.talgalili.com/files/aa.txt;, header = T, : invalid input found on input connection '

[R] How to use read.table with Hebrew column names ?

2010-01-01 Thread Tal Galili
Hello dear R help group, I am trying to read a .txt file, with Hebrew column names, while keeping the column names looking well in R - but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And am trying the command:

Re: [R] How to use read.table with Hebrew column names ?

2010-01-01 Thread milton ruser
Hi Tal, You want the colnames in hebrew? Case not, may be you can use colnames() to attrib new colnames. bests milton On Fri, Jan 1, 2010 at 4:47 PM, Tal Galili tal.gal...@gmail.com wrote: Hello dear R help group, I am trying to read a .txt file, with Hebrew column names, while keeping

Re: [R] How to use read.table with Hebrew column names ?

2010-01-01 Thread Tal Galili
Thanks Milton, But your solution would work for a one time problem, but in case I'd have a variable with Hebrew in it, or many files to process then your solution wouldn't scale up. Thanks anyway :) Tal Contact Details:---

Re: [R] How to use read.table with Hebrew column names ?

2010-01-01 Thread Tal Galili
Hi Jorge, Thank you for the answer, it is a lead. Though I am unsure as to what to do next with it :) Here is my session info: sessionInfo() R version 2.9.1 (2009-06-26) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United

Re: [R] How to use read.table with Hebrew column names ?

2010-01-01 Thread David Winsemius
On Jan 1, 2010, at 4:47 PM, Tal Galili wrote: Hello dear R help group, I am trying to read a .txt file, with Hebrew column names, while keeping the column names looking well in R - but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And am trying the

Re: [R] How to use read.table with Hebrew column names ?

2010-01-01 Thread David Winsemius
You might try: read.table(http://www.talgalili.com/files/aa.txt;, header = T, fileEncoding = UTF-8, sep = \t) -- David. On Jan 1, 2010, at 5:37 PM, Tal Galili wrote: Hi Jorge, Thank you for the answer, it is a lead. Though I am unsure as to what to do next with it :) Here is my session

Re: [R] how to use Rengine instance to parse R script String

2009-12-14 Thread Gray Calhoun
Hi hobartlul, The R-devel mailing list is more appropriate for this sort of question. You'll probably get the best response there if you include your own code (that I assume is not running correctly) and ask about specific errors you're getting---I don't know that anyone has their own small,

Re: [R] how to use Rengine instance to parse R script String

2009-12-14 Thread Romain Francois
On 12/14/2009 01:35 PM, Gray Calhoun wrote: Hi hobartlul, The R-devel mailing list is more appropriate for this sort of question. Slightly, but the one mailing list where the question actually fits is this one : http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel

[R] how to use Rengine instance to parse R script String

2009-12-13 Thread hobartlul
Hello everyone I am currently developing a web based R script editor. My idea is to pass the R script command as a string into the backend , then use the Rengine instance to parse the R script command and get the resutls. Do anyone know how to use Rengine instance to parse a R script String? if

[R] how to use different ylim scales on a lattice bwplot?

2009-12-03 Thread Steve_Friedman
A colleague is interested in modifying the ylim definition for individual panels of a common bwplot plotting statement. Is there an approach to modifying the bwplot function to allow for a dynamic ylim range given different panel factors ? He is using R 2.6.2 on a Linux distribution running

Re: [R] how to use different ylim scales on a lattice bwplot?

2009-12-03 Thread Felix Andrews
You can define a custom prepanel function: see the entry for 'prepanel' in ?xyplot If you just want to set specified ylims in each panel, you can do that by passing a list to 'ylim'. 2009/12/4 steve_fried...@nps.gov: A colleague is interested in modifying the ylim definition for individual

Re: [R] how to use different ylim scales on a lattice bwplot?

2009-12-03 Thread Deepayan Sarkar
On Thu, Dec 3, 2009 at 2:32 PM, Felix Andrews fe...@nfrac.org wrote: You can define a custom prepanel function: see the entry for 'prepanel' in ?xyplot If you just want to set specified ylims in each panel, you can do that by passing a list to 'ylim'. All this assuming, of course, that

[R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Raymond Wong
This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated.   I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing.  How do I assign the values of scale and shape to b and a without manually

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Peter Ehlers
Raymond Wong wrote: This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. How do I assign the values of scale and shape to b and

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 1:47 PM, Peter Ehlers wrote: Raymond Wong wrote: This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing.

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Peter Ehlers
Quite right, David. I forgot to indicate that MASS needs of course to be loaded. It's such a useful package that I usually have it loaded. Raymond: When you ask for help with a function in an add-on package you should indicate that package in your query. -Peter Ehlers David Winsemius wrote:

Re: [R] How to use SQL code in R

2009-11-16 Thread Emmanuel Charpentier
Le lundi 16 novembre 2009 à 13:14 +0800, sdlywjl666 a écrit : Dear All, How to use SQL code in R? Depends on what you mean by using SQL code in R... If you mean Query, update or otherwise mess with an existing database, look at the RODBC packages and/or various RDBI-related packages (hint :

[R] How to use SQL code in R

2009-11-15 Thread sdlywjl666
Dear All, How to use SQL code in R? 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 http://www.R-project.org/posting-guide.html and

[R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} Of course, I suppose this will not work because # is a special character starting a comment line in the rd dialect. I did not found a similar example in Writing R exentions.

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Daniel Malter
von Patrick Giraudoux Gesendet: Wednesday, November 11, 2009 12:15 PM An: r-help@r-project.org Betreff: [R] how to use # in a rd doc in url address I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} Of course, I suppose

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Betreff: [R] how to use # in a rd doc in url address I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} Of course, I suppose this will not work because # is a special character starting a comment line in the rd dialect. I did

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Duncan Murdoch
On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because # is a special character starting a comment line in the

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Duncan Murdoch a écrit : On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because # is a special character

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Patrick Giraudoux a écrit : Duncan Murdoch a écrit : On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because #

[R] How to use package-rsm to generate experimental design

2009-11-10 Thread Rob Wang
Hi guys, I am a totally begginer with R. I am planning to use R to design and optimize my experiment. The experiment includes 4 factors, and three of the fators have 3 levels, and the last factor has 6 levels. I am having a really hard time to learn this program on my own and didn't find

[R] How to use multiple time series in R?

2009-10-08 Thread FMH
Dear All, I have temperature series for 10 different sea levels, where there are 3000 observations for each level. I am planning to use multiple time series modelling on these series, with/ without correlation structure for the residuals. Is there any package that can be used to do this

Re: [R] How to use Subpopulation data?

2009-10-02 Thread Bernardo Rangel Tura
On Fri, 2009-10-02 at 00:42 +, KABELI MEFANE wrote: Thanks But it seems like you don't get my problem.Do you mean that there is something wrong with the code as it seems like what you are doing is suggesting different ways to write a code. Will i get to use the variable that have

Re: [R] How to use Subpopulation data?

2009-10-02 Thread KABELI MEFANE
to shorten this code.   Thanks once again you really helped a lot.Thanks --- On Fri, 2/10/09, Bernardo Rangel Tura t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r

Re: [R] How to use Subpopulation data?

2009-10-02 Thread David Winsemius
On Oct 1, 2009, at 6:06 AM, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000))

Re: [R] How to use Subpopulation data?

2009-10-02 Thread KABELI MEFANE
) sample.strat   Thanks for the input. Once again sorry for wasting your time.   Best Regards      --- On Fri, 2/10/09, David Winsemius dwinsem...@comcast.net wrote: From: David Winsemius dwinsem...@comcast.net Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R

Re: [R] How to use Subpopulation data?

2009-10-02 Thread Peter Ehlers
) sample.strat-getdata(sampleframe,str) sample.strat Thanks for the input. Once again sorry for wasting your time. Best Regards --- On Fri, 2/10/09, David Winsemius dwinsem...@comcast.net wrote: From: David Winsemius dwinsem...@comcast.net Subject: Re: [R] How to use Subpopulation data

Re: [R] How to use Subpopulation data?

2009-10-02 Thread David Winsemius
] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r-project.org Date: Friday, 2 October, 2009, 3:38 PM On Oct 1, 2009, at 6:06 AM, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
Dear Helpers   I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.   H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe  

Re: [R] How to use Subpopulation data?

2009-10-01 Thread Bernardo Rangel Tura
On Thu, 2009-10-01 at 10:06 +, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000))

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
, 1/10/09, Bernardo Rangel Tura t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r-project.org Date: Thursday, 1 October, 2009, 11:24 AM On Thu, 2009-10-01 at 10:06

Re: [R] How to use Subpopulation data?

2009-10-01 Thread Peter Ehlers
? --- On Thu, 1/10/09, Bernardo Rangel Tura t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r-project.org Date: Thursday, 1 October, 2009, 11:24 AM On Thu, 2009-10-01

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
Thanks   i was not aware of str, i have a very large code since i am new to r. I forgot to mention that the package is sampling. Actually i have this simulated code:   n - c(100,400,1000,1500,2000) x - c(2,3,3,3,5) y - c(7,7,9,10,10) s - function(mn, mx, n) {sample(mn:mx, n, replace=TRUE)}

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
: Re: [R] How to use Subpopulation data? To: Peter Ehlers ehl...@ucalgary.ca Cc: R-help@r-project.org, Bernardo Rangel Tura t...@centroin.com.br Date: Thursday, 1 October, 2009, 2:34 PM Thanks   i was not aware of str, i have a very large code since i am new to r. I forgot to mention

Re: [R] How to use Subpopulation data?

2009-10-01 Thread Bernardo Rangel Tura
On Thu, 2009-10-01 at 13:34 +, KABELI MEFANE wrote: ## package sampling stra=strata(sampleframe,c(type,value,rating),size=c(20,80,200,300,400), method=srswor) sample.strat-getdata(sampleframe,stra) sample.strat Try: stra-strata(sampleframe,size=c(20,80,200,300,400),method=srswor)

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: r-help r-h...@stat.math.ethz.ch Date: Thursday, 1 October, 2009, 10:18 PM On Thu, 2009-10-01 at 13:34 +, KABELI MEFANE wrote: ## package sampling stra=strata

Re: [R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-22 Thread Keith Jewell
Thanks Gabor, but my problem isn't finding reasonable starting parameter values, it's preventing nls giving up when it tries parameter values resulting in NA or Inf. I know queries are often over-specific and the appropriate response is don't start there, so I'm trying to balance between

Re: [R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-22 Thread Gabor Grothendieck
With good starting values it often won't need to try anything outside feasible region. If after trying better starting values you find that that it is still attempting to move outsie the feasible region then another approach is to use the boundary value plus some monotonic function of the

[R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-21 Thread Keith Jewell
Hi Everyone, I posted this a couple of weeks ago with no responses. My interface (via gmane) seemed a bit flakey at the time, so I'm venturing to repost with some additional information. I'm trying to write selfStart non-linear models for use with nls. In these models some combinations of

Re: [R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-21 Thread Gabor Grothendieck
With a small number of parameters just use brute force on grid to calculate starting values. See nls2 package. On Mon, Sep 21, 2009 at 12:17 PM, Keith Jewell k.jew...@campden.co.uk wrote: Hi Everyone, I posted this a couple of weeks ago with no responses. My interface (via gmane) seemed a

Re: [R] How to use your own data in gstat and sp?

2009-08-18 Thread Paul Heinrich Dietrich
Thanks that makes sense. Just a newby to spatial data in R. Thanks. Roger Bivand wrote: First re-read the definition of what a SpatialPixels object is - ?SpatialPixels-class - note that it says: class for defining a pixels, forming a possibly incomplete rectangular grid of arbitrary

Re: [R] How to use R to perform prediction based on history data

2009-08-18 Thread Gabor Grothendieck
Please read the last line to every message on r-help and note the request to provide reproducible code. Anyways, try this: Lines - Field1 Field2 Field3 Field4 ResultField 1231CA TRUE443TRUE 23231 NC TRUE123FALSE 1231CAFALSE243

Re: [R] How to use R to perform prediction based on history data

2009-08-18 Thread yu su
Thank you very much, it works cool! On Tue, Aug 18, 2009 at 9:38 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: Please read the last line to every message on r-help and note the request to provide reproducible code. Anyways, try this: Lines - Field1 Field2 Field3     Field4  

[R] How to use your own data in gstat and sp?

2009-08-16 Thread Paul Heinrich Dietrich
This seems pretty basic, but I can't get any data to work except for the documented examples. When the goal is to get to SpatialPixels, here is what I see... x - runif(10,1,10) y - runif(10,1,10) z - rnorm(10,0,1) MyData - as.data.frame(cbind(x,y,z)) library(gstat) coordinates(MyData) -

[R] How to use R to perform prediction based on history data

2009-08-15 Thread Jack Su
Say I have a csv file, each row contains several fields, one of them are whether the row is success. In history data, I have all the fields including the result of whether it is success. In future data, I only have fields without the result. For example: history data: Field1 Field2 Field3

Re: [R] How to use R to perform prediction based on history data

2009-08-15 Thread Daniel Malter
@r-project.org Betreff: [R] How to use R to perform prediction based on history data Say I have a csv file, each row contains several fields, one of them are whether the row is success. In history data, I have all the fields including the result of whether it is success. In future data, I only

[R] how to use do.call together with cbind and get inside a function

2009-07-26 Thread Sean Zhang
Dear R-helpers: I have a question related to using do.call to call cbind and get. #the following works vec1 - c(1,2) vec2 - c(3,4) ColNameVec - c('vec1','vec2') mat - do.call(cbind,lapply(ColNameVec,get)) mat #put code above into a function then it does not work #before doing so, first remove

Re: [R] how to use do.call together with cbind and get inside a function

2009-07-26 Thread Gabor Grothendieck
Use lapply(ColNameVec, get, environment()) so that it gets the objects from the current environment. See: ?get ?environment On Sun, Jul 26, 2009 at 11:16 PM, Sean Zhangseane...@gmail.com wrote: Dear R-helpers: I have a question related to using do.call to call cbind and get. #the following

[R] How to use macro variable in a text string

2009-07-22 Thread kxk
I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in 1970:2005) { edge - read.table(file=edge_t.csv,

Re: [R] How to use macro variable in a text string

2009-07-22 Thread Steve Lianoglou
Hi, On Jul 22, 2009, at 5:46 PM, kxk wrote: I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in

Re: [R] How to use macro variable in a text string

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 5:46 PM, kxk wrote: I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in

Re: [R] How to use macro variable in a text string

2009-07-22 Thread Jorge Ivan Velez
Dear kxk, Here are a couple of options: # Option 1 -- sapply mydata - sapply(1970:2005, function(i){ mydata - read.table(file = paste(edge_, i, .csv, sep=), header=TRUE) # more code goes here } ) Please note that

[R] how to use a list to create a plot

2009-07-21 Thread Graves, Gregory
I issued the following command to obtain the std dev for each month. psd-numSummary(Sal, groups=month, statistics=c(sd)) which resulted in psd sd n NA 1 6.930340 9367 2319 2 7.847003

Re: [R] how to use a list to create a plot

2009-07-21 Thread Uwe Ligges
Graves, Gregory wrote: I issued the following command to obtain the std dev for each month. psd-numSummary(Sal, groups=month, statistics=c(sd)) numSummary is not in base R, is it? If not, which package? Please read the posting guide! Please provide reproducible code (we do not have

Re: [R] how to use a list to create a plot

2009-07-21 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.07.2009 14:37:35: Graves, Gregory wrote: I issued the following command to obtain the std dev for each month. psd-numSummary(Sal, groups=month, statistics=c(sd)) numSummary is not in base R, is it? If not, which package? Please

Re: [R] how to use a list to create a plot

2009-07-21 Thread John Kane
to the data.frame and then plotting psd - xx psd[,4] - 1:12 names(psd)[4] - months plot(sd~months, data=psd) --- On Tue, 7/21/09, Graves, Gregory ggra...@sfwmd.gov wrote: From: Graves, Gregory ggra...@sfwmd.gov Subject: [R] how to use a list to create a plot To: r-help@r-project.org Received

[R] how to use writeFASTA in modality append

2009-07-16 Thread mauede
It looks like Biostrings function writeFASTA overwrites the output file at each run. It seems it does not support the append parameter. I have to generate one big file gathering a miRNA identifier and relative sequence followd by a variable number of dara records pertaining such a miRNA

Re: [R] How to use current value of variable in function definition?

2009-07-03 Thread Mark Wardle
2009/7/2 Peter Dalgaard p.dalga...@biostat.ku.dk: Mark Wardle wrote: [...] Otherwise, it sounds like a recipe for obfuscation! What are you trying to do really? Not really obfuscation, there are legitimate reasons to want this sort of behaviour. See demo(scoping) for a related example

<    1   2   3   4   5   6   >