Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread Allan Tanaka
lf Of Allan > Tanaka > Sent: Thursday, March 16, 2017 3:16 AM > To: William Dunlap > Cc: r-help@r-project.org > Subject: Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values > >  Hi. Thanks for the function. My bad, after looking at the csv file, it seems >that > N

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread PIKAL Petr
b -0.09767088 6 b -1.02719060 7 c 2.35787246 8 c -0.07513048 9 c -0.17164728 > Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Allan > Tanaka > Sent: Thursday, March 16, 2017 3:16 AM > To: William Dunlap > Cc:

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread Allan Tanaka
Hi. Thanks for the function. My bad, after looking at the csv file, it seems that NA values come not only from previous Non-NA values but also from the next Non-NA values. Example: | NCQ05 | 11.395 | | NCQ05 | 11.395 | | NCQ05 | | | NCQ06 | | | NCQ06 | 13 | | NCQ06 | 13 | If i use the functi

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread PIKAL Petr
Hi why nonumeric values in data identifier matters? Some toy data dat<-data.frame(ie=rep(letters[1:3], each=3), iw=rnorm(9)) dat[c(2, 4,6, 9),2]<-NA library(zoo) ave(dat$iw, dat$ie, FUN=function(x) na.locf(x, na.rm=FALSE)) You can use ave together with na.locf to propagate nonumeric values only

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-15 Thread William Dunlap via R-help
You could use the following function locf2 <- function(x, initial=NA, IS_BAD = is.na) { # Replace 'bad' values in 'x' with last previous non-bad value. # If no previous non-bad value, replace with 'initial'. stopifnot(is.function(IS_BAD)) good <- !IS_BAD(x) stopifnot(is.logical

Re: [R] Help me

2016-03-02 Thread Morteza Firouzi via R-help
 Moses, If I understand correctly, you are installed R and Rstudio.Please do find the package(s) you would like to use.Once you run rstudio, you can search and install the package(s) using the bottom right corner menu:Packages> Install> install from Repository (Cran)> search the package you woul

Re: [R] Help me in cluster

2015-09-11 Thread Sarah Goslee
Please reply to the list, not just me. I've added the list address to my own reply. On Fri, Sep 11, 2015 at 11:04 AM, Ghada Almousa wrote: > If you don't help me , why put help and subscription > this is not a homework it's question I searched in the web but there is > no answer The participa

Re: [R] Help me in cluster

2015-09-11 Thread Sarah Goslee
Repeating your post won't help. Writing a good question with sample data and the code you've tried, as well as describing your *specific* difficulties will. Without a reproducible example that includes some sample data provided using dput() (fake is fine), the code you used, and some clear idea of

Re: [R] Help me in cluster

2015-09-11 Thread Ghada Almousa
On Tuesday, September 8, 2015, Ghada Almousa wrote: > I have project to study and analysis clusters algorithm in R > "K-mean, Hierarchical, Density based and EM" > I want to calculate > Cluster instance , number of iteration , sum of squared error SSE and the > accuracy for each cluster algorithm

Re: [R] Help me

2014-11-24 Thread Bert Gunter
No. See the posting guide link below for how to ask an intelligible question. Better yet, do your homework (is that what this is?) yourself: http://cran.r-project.org/doc/manuals/R-intro.pdf -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Informa

Re: [R] help me align the legend bar

2013-10-30 Thread Adams, Jean
You could use the mar= argument of the par() function to define a wider plot margin on the right, then change the first and third arguments of color.legend() to make the legend fit in the margin. For example, par(mar=c(3, 1, 3, 7)) color2D.matplot(test, axes="F", xlab="", ylab="", main="color.sca

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thank you very much for your help and time. That works very nicelyThanks again! - Original Message - From: John Kane To: David Lyon ; r-help Cc: Sent: Wednesday, May 15, 2013 9:36 AM Subject: Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates My

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thanks John for your reply. I did include the data if you scroll down to the end of my original email. Can someone help me on this? Thanks - Original Message - From: John Kane To: David Lyon ; r-help Cc: Sent: Tuesday, May 14, 2013 4:11 PM Subject: RE: [R] Help me please: gplot

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread John Kane
t;, "4/10/13", "4/22/13"), value = c(0.16, 0.16, 0.42, 0.81, 0.16, 2.93, 2.4, 1.36, 1.22, 0.77, 0.85, 1.22, 0.21, 1.81, 0.54, 1.33, 1.32, 2.5, 1.3, 1.1, 0.66, 0.84, 7.42, 1.21, 0.97, 2.25, 0.51, 0.53, 0.41, 3.14, 3.58, 2.41, 2.08, 3.2, 0.24, 0.34, 0.58, 0.54, 0.25, 0.39, 0.28, 0.19, 0.42, 0.39, 0.26, 0.16, 0.16, 0.16, 0.16, 1.

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-14 Thread David Winsemius
Your value column will be input as character because of the "<" signs and you need to convert the dates in %m/%d/%y format to real R dates. -- David Sent from my iPhone On May 14, 2013, at 3:59 PM, David Lyon wrote: > I have a text file of data as below and doing a ggplot line plot of all the

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-14 Thread John Kane
Thank you for supplying the code. It would be easier to help you if we also had some data to work with. ?dput https://github.com/hadley/devtools/wiki/Reproducibility I think reorder() is likely to do the trick but I don't have enough time to mock up some data and check at the moment. Have a

Re: [R] help me out

2013-03-01 Thread Greg Snow
If you want to receive all the e-mails, but don't want your e-mail program to pop up a message every time an e-mail from r-help comes in then you can configure your e-mail client to automatically move all the e-mails from r-help to a specific folder/label/etc. and that should make it so you can loo

Re: [R] help me out

2013-03-01 Thread Ista Zahn
Hi, On Fri, Mar 1, 2013 at 6:31 AM, ankita kumari wrote: > i dont want to receive messages about all the posts as i get too many in my > inbox. how can i get emails from everyone who posts in this site. > please help me out Maybe you are looking for digest mode? got to https://stat.ethz.ch/mailm

Re: [R] help me out

2013-03-01 Thread Berend Hasselman
On 01-03-2013, at 12:31, ankita kumari wrote: > i dont want to receive messages about all the posts as i get too many in my > inbox. You don't want to get the emails? > how can i get emails from everyone who posts in this site. You do want the emails? > please help me out > Difficult given

Re: [R] HELP me please with import of csv to R

2012-11-25 Thread F86
I have solved the problem. And as i assumed from the beginning it was a simple one. The problem was that i had my csv file on the descop. It should have been in the working directory. So i just needed to read the file and then run lm() like i wrote before. Thanks to Ray DiGiacomo, Jr! Regard

Re: [R] Help me please to code....

2012-10-22 Thread Rlotus
thank you so much for helping! Now i got how to do it ;) -- View this message in context: http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932p4647050.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

Re: [R] Help me please to code....

2012-10-21 Thread arun
HI, Try this: fun1<-function(X){  Y<-ifelse(X==0,5/2,7)  return(Y)}  fun1(5) #[1] 7  fun1(0) #[1] 2.5  fun1(2) #[1] 7 A.K. - Original Message - From: Rlotus To: r-help@r-project.org Cc: Sent: Sunday, October 21, 2012 3:03 PM Subject: [R] Help me please to code User has to type (

Re: [R] Help me please to code....

2012-10-21 Thread Rui Barradas
Hello, First of all, you should _really_ try to read An Introduction to R, file R-intro.pdf that comes with every installation of R. The answer to your question is in chapter 9 Grouping, loops and conditional execution. It's the very first example: "9.2.1 Conditional execution: if statements

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of William Dunlap > Sent: Wednesday, July 11, 2012 4:23 PM > To: F86; r-help@r-project.org > Subject: Re: [R] HELP me please with import of csv to R > > Y

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread William Dunlap
tware wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of F86 > Sent: Wednesday, July 11, 2012 2:47 PM > To: r-help@r-project.org > Subject: Re: [R] HELP me please with import of csv to R > > Hell

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread F86
Hello William, - I used str() and got this 'data.frame': 290 obs. of 2 variables: $ Kommuner: Factor w/ 289 levels "Ale","Alingsas",..: 34 40 44 79 95 99 132 162 169 173 ... $ Skatt : Factor w/ 177 levels "28,89","28,9",..: 86 7 47 67 74 25 24 23 85 74 ... - and summary() - got this

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread William Dunlap
m: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of F86 > Sent: Wednesday, July 11, 2012 2:40 AM > To: r-help@r-project.org > Subject: Re: [R] HELP me please with import of csv to R > > Thank you! It is fixed now. > > However, now when I'm tryi

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread F86
Thank you! It is fixed now. However, now when I'm trying with hist(skatter) i get this message: Error in hist.default(skatter) : 'x' must be numeric I don't know what I'm doing wrong but it worked perfectly on windows some weeks ago. My data skatter looks like this: > skatter

Re: [R] HELP me please with import of csv to R

2012-07-11 Thread F86
Thank you! It is fixed now. However, now when I'm trying with hist(skatter) i get this message: Error in hist.default(skatter) : 'x' must be numeric I don't know what I'm doing wrong but it worked perfectly on windows some weeks ago. My data skater looks like this: > skatter Ko

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread R. Michael Weylandt
On Tue, Jul 10, 2012 at 4:23 PM, FJ M wrote: > 3) attach the data so that the headers become objects that contain the data > attach(v_data) This is a discouraged practice as it leads to difficult to trace errors and non-local effects. Some "big names" of the R universe suggest it [I think V of V

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread FJ M
Try putting the data into some kind of object. I'm not sure what R does with the data from read.csv. I always 1) read the data into an object 2) print the data out 3) attach the data so that the headers become objects that contain the data 4) and yes, print the data out using ls 5) check the ou

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread peter dalgaard
On Jul 11, 2012, at 01:24 , Sarah Goslee wrote: > That is silly, but I have learned something. Thanks. > (The silliest bit was when someone decided that numeric data files should use locale-dependent conventions, notably decimal separators...) > Though honestly, I've never seen the advantage o

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread Sarah Goslee
That is silly, but I have learned something. Thanks. Though honestly, I've never seen the advantage of read.csv() over the more versatile read.table(). Sarah On Tuesday, July 10, 2012, peter dalgaard wrote: > > On Jul 10, 2012, at 21:44 , Sarah Goslee wrote: > > > > But note that if sep=";" the

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread peter dalgaard
On Jul 10, 2012, at 21:44 , Sarah Goslee wrote: > > But note that if sep=";" then you don't have a csv file and should > properly use read.table() instead. That's not actually true. In a substantial part of the world, csv files are semicolon separated. That's what read.csv2() is for. (Yes, it i

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread Sarah Goslee
Hi, On Tue, Jul 10, 2012 at 12:48 PM, F86 wrote: > Hey, > > I am having problems with importing a csv file to R. > > I could read the file by typing: > read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") So that command does work? > However, i can not analyze the "skatter" -

Re: [R] help me....

2011-12-17 Thread Stephen Sefick
This definatley looks like homework. On Sat 17 Dec 2011 05:36:03 AM CST, jurassic85 wrote: Life times of one brand of light bulb were observed. Life hours of nine light bulbs were 898, 720, 354, 405, 620, 54, 229, 306, 890. There were three more light bulbs that were still burning after 1000 hou

Re: [R] help me....

2011-12-17 Thread David Winsemius
On Dec 17, 2011, at 6:36 AM, jurassic85 wrote: Life times of one brand of light bulb were observed. Life hours of nine light bulbs were 898, 720, 354, 405, 620, 54, 229, 306, 890. There were three more light bulbs that were still burning after 1000 hours. It is common to assume the life ti

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Alaios
Thank you very much . That was really helpful. I will keep this email for future reference Regards --- On Mon, 4/18/11, Duncan Murdoch wrote: > From: Duncan Murdoch > Subject: Re: [R] Help me create a hyper-structure > To: "Alaios" > Cc: r-h...@stat.math.ethz.ch, "

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Duncan Murdoch
ank you in advance for your help Best Regards Alex --- On Sat, 4/16/11, Ben Bolker wrote: > From: Ben Bolker > Subject: Re: [R] Help me create a hyper-structure > To: r-h...@stat.math.ethz.ch > Date: Saturday, April 16, 2011, 3:39 PM > Alaios > yahoo.com> write

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Ben Bolker
On 11-04-18 04:45 AM, Alaios wrote: > It seems you were right. > Now I can easily access my struct and substruct like this > > # all.str[[1]]] Gives access to the first struct of per.sr.struct which > containts 101 times the xorder,yorder,estimation.sr > # all.str[[1]][[2]] Gives access to the se

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Alaios
of assignments or not? I would like to thank you in advance for your help Best Regards Alex --- On Sat, 4/16/11, Ben Bolker wrote: > From: Ben Bolker > Subject: Re: [R] Help me create a hyper-structure > To: r-h...@stat.math.ethz.ch > Date: Saturday, April 16, 2011, 3

Re: [R] Help me create a hyper-structure

2011-04-16 Thread Alaios
ubject: Re: [R] Help me create a hyper-structure > To: r-h...@stat.math.ethz.ch > Date: Saturday, April 16, 2011, 3:39 PM > Alaios > yahoo.com> writes: > > > > > Dear all > > I would like to have in R a big struct containing a > smaller struct. > >

Re: [R] Help me create a hyper-structure

2011-04-16 Thread Ben Bolker
Alaios yahoo.com> writes: > > Dear all > I would like to have in R a big struct containing a smaller struct. > > 1) I would like to have a small struct with the following three fields > xorder (an integer ranging from 0 to 20) > yorder (an integer ranging from 0 to 20) > estimated (a 256*256

Re: [R] help me

2010-12-31 Thread Petr Savicky
On Thu, Dec 30, 2010 at 11:01:47PM -0800, Sintayehu Aynalem wrote: > I nanna subscribe to r-help. > > Can you please guide me... Start at http://www.r-project.org/ Click on "Mailing lists". Find section "R-help". Click on "web interface". Find section "Subscribing to R-help" and follow the desc

Re: [R] Help me with R plotting

2010-11-18 Thread Alaios
Thanks a lot :) nice one --- On Thu, 11/18/10, baptiste Auguié wrote: From: baptiste Auguié Subject: Re: [R] Help me with R plotting To: "Alaios" Cc: "Rhelp" Date: Thursday, November 18, 2010, 3:34 PM Hi, Try this, robots <- data.frame(id=letters[1:20],        

Re: [R] Help me with R plotting

2010-11-18 Thread Tal Galili
s" > > Also I tried legend... which creates small boxes below the dots which is Do > not what I want exactly. I would like below every plot to write some text > but not inside any box that will cover part of the image. > > Best Regards > Alex > > --- On *Thu, 11/18/10,

Re: [R] Help me with R plotting

2010-11-18 Thread baptiste Auguié
o write some text but > not inside any box that will cover part of the image. > > Best Regards > Alex > > --- On Thu, 11/18/10, Tal Galili wrote: > > From: Tal Galili > Subject: Re: [R] Help me with R plotting > To: "Alaios" > Cc: "Rhelp"

Re: [R] Help me with R plotting

2010-11-18 Thread Alaios
text but not inside any box that will cover part of the image. Best Regards Alex --- On Thu, 11/18/10, Tal Galili wrote: From: Tal Galili Subject: Re: [R] Help me with R plotting To: "Alaios" Cc: "Rhelp" Date: Thursday, November 18, 2010, 2:13 PM ?plotWill give a goo

Re: [R] Help me with R plotting

2010-11-18 Thread Tal Galili
?plot Will give a good solution #Example: set.seed(5) xx <- data.frame(x = runif(50), y = runif(50), z = sample(c(1:3), 50, T)) with(xx, plot(x, y, col = z, pch = 19)) Now you can start going into how to play with the colors, and how to add ?legend to the image... Tal Contact

Re: [R] Help me pls

2010-09-23 Thread Michael Hannon
> From: Seyit Ali KAYIS > To: r-help@r-project.org > Sent: Thu, September 23, 2010 12:12:49 AM > Subject: [R] Help me pls > > Dear All, > > I need to create eps file which is the required figure format of the > journal that I want to submit a paper. I am able to create files in pdf or > wm

Re: [R] Help me pls

2010-09-23 Thread Michael Bedward
The postscript function ? On 23 September 2010 17:12, Seyit Ali KAYIS wrote: > Dear All, > > I need to create eps file which is the required figure format  of the > journal that I want to submit a paper. I am able to create files in pdf or > wmf format but not in eps format. Is there a way to con

Re: [R] help me understand how things work.

2010-09-16 Thread Mario Valle
s Alex *From:* Mario Valle *To:* Alaios *Sent:* Thu, September 16, 2010 1:28:31 PM *Subject:* Re: [R] help me understand how things work. ?dist BTW, to me this does not happens. x <- matrix(rnorm(100), nrow=5) d <- dist(x) 1/sqrt(d) 1/sqrt(dist(x)) H

Re: [R] help me understand how things work.

2010-09-16 Thread Alaios
, 2010 1:28:31 PM Subject: Re: [R] help me understand how things work. ?dist BTW, to me this does not happens. x <- matrix(rnorm(100), nrow=5) d <- dist(x) 1/sqrt(d) 1/sqrt(dist(x)) Hope it helps mario On 16-Sep-10 12:02, Alaios wrote: > Hello I ha

Re: [R] help me understand how things work.

2010-09-16 Thread Julian Burgos
Hi Alex, What is happening is that the ´dist´function calculates a distance matrix, and returns an object of the ´dist´ class. > temp <- rbind (c(10,1),c(99,98)) > x=dist(temp) > x 1 2 131.6435 > class(x) [1] "dist" You can see a description of the ´dist´class at the end of the function

Re: [R] help me understand how things work.

2010-09-16 Thread Michael Bedward
Hello Alex, Look at the help page for the dist function. You'll see it doesn't return a simple vector or matrix, rather a "dist" class object which is why you got a surprise when you tried to treat it like a simple value. The function is not really intended for spatial point distance calculations,

Re: [R] help me with holt-winter model

2010-07-22 Thread Research student
Please help me with this i need to submit my thesis . Thanks In advance -- View this message in context: http://r.789695.n4.nabble.com/help-me-with-holt-winter-model-tp2295552p2298464.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Help me with prediction in linear model

2010-07-21 Thread Dennis Murphy
Hi: On Wed, Jul 21, 2010 at 8:46 AM, vijaysheegi wrote: > > Hi R-community, > I have the code as follows,i Fitted model as follows > lbeer<-log(beer_monthly) > t<-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ > entries > This is unnecessary: > t2=t^2 > beer_fit_parab

Re: [R] Help me with writing function sort()

2010-04-11 Thread Barry Rowlingson
On Sun, Apr 11, 2010 at 2:30 PM, maslakos wrote: > > Hello everyone, i`m new here.. I just started with learning R language and i > have hard "homework". I need to write function like sort().. Anyone know how > to do it? Can u give me algorithm for sorting vector? x=c(1,2,-1,1,3,4) or > something

Re: [R] Help me with writing function sort()

2010-04-11 Thread Martin Morgan
On 04/11/2010 06:30 AM, maslakos wrote: > > Hello everyone, i`m new here.. I just started with learning R language and i > have hard "homework". I need to write function like sort().. Anyone know how > to do it? Can u give me algorithm for sorting vector? x=c(1,2,-1,1,3,4) or > something like that

Re: [R] Help me with writing function sort()

2010-04-11 Thread GlenB
http://lmgtfy.com/?q=sort+algorithm -- View this message in context: http://n4.nabble.com/Help-me-with-writing-function-sort-tp1836063p1836181.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://s

Re: [R] Help me! using random Forest package, how to calculate Error Rates in the training set ?

2010-01-11 Thread bbslover
beginner, so I need learn a lot. Thank you kevin 在2010-01-12,"Liaw, Andy [via R]" 写道: -原始邮件- 发件人:"Liaw, Andy [via R]" 发送时间:2010年1月12日 星期二 收件人:bbslover 主题:Re: [R] Help me! using random Forest package, how to calcu

Re: [R] Help me! using random Forest package, how to calculate Error Rates in the training set ?

2010-01-11 Thread Liaw, Andy
From: bbslover > > now I am learining random forest and using random forest > package, I can get > the OOB error rates, and test set rate, now I want to get the > training set > error rate, how can I do? > > pgp.rf<-randomForest(x.tr,y.tr,x.ts,y.ts,ntree=1e3,keep.forest > =FALSE,do.trace=1e2)

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 5:05 PM, Andrew Barr wrote: Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) mtx <- matrix(scan(textConnectio

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread Charles C. Berry
On Fri, 20 Nov 2009, Andrew Barr wrote: Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of inter

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread Dylan Beaudette
?dist On Friday 20 November 2009, Andrew Barr wrote: > Hi R folks, > > I have a massive array (object name "points") in the following form > > [,1] [,2] > [1,] 1369 22 > [2,] 1370 22 > [3,] 1368 23 > [4,] 1369 23 > [5,] 1370 23 > [6,] 1371 23 > (10080 rows truncated) > > Thes

Re: [R] Help me improving my code

2009-10-31 Thread David Winsemius
This is rather obviously homework, and you have not read the Posting Guide, and you have not addressed the question of academic integrity policies that are probably in force at your university. -- David On Oct 31, 2009, at 1:30 PM, md. jakir hussain talukdar wrote: Hi, I am new to R. My pr

Re: [R] Help me replace a for loop with an "apply" function

2009-10-01 Thread jim holtman
What I am doing is trying to determine where the dates are not sequential (difference is not one day). Everytime that this occurs, the expression 'diff(.days) != 1' is TRUE and this is where a new sequence starts. 'diff' will return a vector one shorter than its input; I am assuming that the firs

Re: [R] Help me replace a for loop with an "apply" function

2009-10-01 Thread gd047
Congratulations! Could you explain to me the reason you add an initial "TRUE" value in the cumulatice sum? jholtman wrote: > > Will this work: > >> x <- read.table(textConnection(" day user_id > + 2008/11/012001 > + 2008/11/012002 > + 2008/11/012003 > + 2008/11/0120

Re: [R] Help me replace a for loop with an "apply" function

2009-10-01 Thread jim holtman
Will this work: > x <- read.table(textConnection(" day user_id + 2008/11/012001 + 2008/11/012002 + 2008/11/012003 + 2008/11/012004 + 2008/11/012005 + 2008/11/022001 + 2008/11/022005 + 2008/11/032001 + 2008/11/032003 + 2008/11/032004 + 2008/11/03

Re: [R] Help me get this function to work...

2009-07-13 Thread Duncan Murdoch
On 7/13/2009 3:21 PM, Mark Knecht wrote: On Mon, Jul 13, 2009 at 12:08 PM, David Winsemius wrote: In R a function only returns the last evaluation, so you need to wrap up all of the local results into a list at the end of the function. David Winsemius, MD Heritage Laboratories West Hartfo

Re: [R] Help me get this function to work...

2009-07-13 Thread Bert Gunter
How important it is to wrap the list in a return statement, ala return(list(ShrubCover.df, TreeCover.df, TotalCover.df)) or answer <- list(ShrubCover.df, TreeCover.df, TotalCover.df) return(answer) --- Completely Un. Consult the R Docs, especially the R Language Definition manual, for answers

Re: [R] Help me get this function to work...

2009-07-13 Thread Mark Knecht
On Mon, Jul 13, 2009 at 12:08 PM, David Winsemius wrote: > In R a function only returns the last evaluation, so you need to wrap up all > of the local results into a list at the end of the function. > > > > David Winsemius, MD > Heritage Laboratories > West Hartford, CT > How important it is to

Re: [R] Help me get this function to work...

2009-07-13 Thread David Winsemius
In R a function only returns the last evaluation, so you need to wrap up all of the local results into a list at the end of the function. On Jul 13, 2009, at 1:23 PM, Chip Maney wrote: I have a function (see below). This function has one object, ID. If I run the loops by itself using a

Re: [R] help me about data format.

2009-07-07 Thread Claudia Beleites
> I want to make a matrix and vector in same data frame. You need to protect your matrix by I () Btw: I'm actually writing a package for handling spectra that I plan to release in some weeks. It contains a vignette showing how pls calibration can be done. If you want to give it a try, let me k

Re: [R] Help me...!!!

2009-05-26 Thread Carl Witthoft
From: Doran, Harold Date: Tue, 26 May 2009 14:26:53 -0400 The bad news, as others have indicated, is that this list is not for homework. The good news is that all of this is extremely easy in R!!! > -Original Message- > From: r-help-bounces_at_r-project.org > [mailto:r-help-bounces_a

Re: [R] Help me...!!!

2009-05-26 Thread Doran, Harold
The bad news, as others have indicated, is that this list is not for homework. The good news is that all of this is extremely easy in R!!! > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of abel1682 > Sent: Tuesday, May 26, 2009

Re: [R] Help me...!!!

2009-05-26 Thread Kevin E. Thorpe
Is this homework? If so, please read the posting guide and note the part about homework. Specifically, "Basic statistics and classroom homework: R-help is not intended for these." http://www.r-project.org/posting-guide.html abel1682 wrote: Hi to all...i'm a new R'user and i have to solve s

Re: [R] Help me...!!!

2009-05-26 Thread Mike Lawrence
http://www.r-project.org/posting-guide.html "Basic statistics and classroom homework: R-help is not intended for these. " On Tue, May 26, 2009 at 11:37 AM, abel1682 wrote: > > Hi to all...i'm a new R'user and i have to solve some exercies so i ask to > tou for an help... > > 1.) How i can demon

Re: [R] Help me...!!!

2009-05-26 Thread Simon Pickett
have a read at these pdfs http://cran.r-project.org/other-docs.html you are likely to get a bashing for asking people to do your homework for you! Simon. - Original Message - From: "abel1682" To: Sent: Tuesday, May 26, 2009 3:37 PM Subject: [R] Help me...!!! Hi to all...i'm

Re: [R] help me

2009-01-11 Thread Gabor Grothendieck
Do you mean how to create an R function, CD, that represents the resulting function of x? If that's it then try this: > CD <- function(x) {} > body(CD) <- yacas("Integrate(y,0,1-x)2 - x - y - 1")[[1]] > CD function (x) (1 - x)^2 - (1 - x)^2/2 See ?bodyAsExpression for more info. Also try:

Re: [R] help me

2009-01-05 Thread stephen sefick
Is this homework? Anyway, the attachment has been stripped off. Here is how to plot the function. fun <- function(x, y){ a <- 4 b <- x^2 d <- y^2 z <- a-b-d return(z) } a <- fun(seq(-1000,1000,1), seq(-1000,1000,1)) plot(a) #integration s

Re: [R] Help me: nls and try function

2008-08-13 Thread jim holtman
For the first question, you have provided the answer -- try(nls(...)). Was there something else you wanted? For part 2, this should work: for (i in names(myData)[-1]){ # skip first column with "Time" write.table(myData[, c("Time", i)], file=i) } > 1) How can use the function try in nls mo

Re: [R] help me to debug this part of code?

2008-04-20 Thread francogrex
jinjin wrote: > > I am trying to solve the integration equation, for different values of K > from 4 to 25, the integration is with respect to u, > Here is the equation:gamma(k/2) / ( sqrt(k-1)*gamma((k-1)/2) ) * > integrate(f= (1+u^2/k-1)^(-k/2), lower=0, upper= sqrt(a^2*k/(k+1-a^2)) ) = >

Re: [R] help me to debug this part of code?

2008-04-18 Thread francogrex
There are a lot of syntax errors such as unclosed parentheses, missing commas etc; Example: exp@(@lgamma((k+1)/2)-lgamma(k/2)*1/sqrt(k), where the parenthesis between the @s is not closed. I suggest you get an editor such as "Tinn" that can highlight those for you. In addition I notice that you us

Re: [R] help me to debug this part of code?

2008-04-18 Thread Charles C. Berry
On Fri, 18 Apr 2008, jinjin wrote: > > I am trying to solve the integration equation, for different values of K from > 4 to 25, the integration is with respect to u, > > Here is the equation:gamma(k/2) / ( sqrt(k-1)*gamma((k-1)/2) ) * > integrate(f= (1+u^2/k-1)^(-k/2), lower=0, upper= sqrt(a^2

Re: [R] Help me about singular error nls

2008-04-08 Thread Dieter Menne
jarod_v6 libero.it> writes: > > I have that problem: > this is file : PBS.txt > Time RFU > 0.27.3021 > 0.080026.1565 > rm(list=ls()) > print("ls()") > #carica Dati con file di testo > > b <-read.table("PBS.txt", sep="\t", header= TRUE) > print("b") > b > nlmod1 <- nls(R

Re: [R] Help me please...Large execution time in auto.arima() function

2007-11-08 Thread Joao Santos
Hello again, Sorry but the code that I insert wasn't write. Should be like this: fit_2323v_168f<-auto.arima(regts.ts, d = NA, D = NA, max.p = 2, max.q = 2, max.P = 1, max.Q = 1, max.order = 5, start.p=0, start.q=0, start.P=0, start.Q=0, stationary

Re: [R] Help me in Cochran armitage trend test Coding

2007-10-31 Thread Henric Nilsson (Public)
Shibu John wrote: > Dear sir, > > I am Shibu John from Thrombosis Research Institute India. It is a > multidisciplinary organisation concerned with the interrelated problems of > thrombosis and atherosclerosis. > > I was searching for Cochran armitage trend test program in R. Then I had > seen