[R] Need Help!

Boris Steipe boris.steipe at utoronto.ca
Tue May 5 21:10:09 CEST 2015

For crying out loud Dawood - can you please stop posting screenshots? Do you not know how to copy your output and paste it into the body of a (not HTML formatted!) email? Let us know if you need help with that.


On May 5, 2015, at 11:05 AM, dawood ahmad <dawoodmalik at hotmail.com> wrote:

> Dear Daniel,
> Thank you very much for such a kind reply. Actually, I couldn't understand well the criteria of help list, I am 
> sorry for that. I tried you method, unfortunately I couldn't get the output. It may be due to my lack of expertise in programming. At this point I need your help which will mean a lot to me. Moreover, if I use single value it gives the output. I am sending you two image files of the outputs. I will be really grateful to you if you guide me.
> Thanking in advance,
> With Best Regards,
> Dawood
>> From: kehld at ktk.pte.hu
>> To: dawoodmalik at hotmail.com; r-help at r-project.org
>> Subject: RE: [R] Need Help!
>> Date: Mon, 4 May 2015 20:17:48 +0000
>> Dear Dawood,
>> it is not a really good idea to open a new email with the same problem you already posted earlier.
>> I see you accepted some suggestions (HTML, seq) but not others (pi is a defined constant in R, do not change it, type pi ENTER to see this.). I would like to add one more, c is a function, do not use it as a variable name (I used cc instead of c).
>> I tried to figure out what you want here. The following code might do what you want. It gives you a feeling about how you would create a basic loop. There are nicer ways to do that in R. Note the [i]-s in the for loop!
>> cc <- 0.5
>> xc <- 2
>> s <- 6
>> Hc2 <- 30
>> H <- 1
>> ep<-seq(0.01, 0.49, by=0.001)
>> res <- numeric(length=length(ep))
>> for (i in 1:length(ep)){
>>  f<-function(k) 1.211*10^(-6)*Hc2/H*(trigamma( ((ep[i] + H/Hc2 + (2*xc/s)^2*(1 - cos(k*s))/2)/2*Hc2/H)) -  trigamma(((cc + H/Hc2 + (2*xc/s)^2*(1 - cos(k*s))/2)/2*Hc2/H)))
>>  res[i] <- integrate(f,-pi/s,pi/s)$value
>> }
>> Best,
>> daniel
>> ________________________________________
>> Feladó: R-help [r-help-bounces at r-project.org] ; meghatalmazó: dawood ahmad [dawoodmalik at hotmail.com]
>> Küldve: 2015. május 4. 10:29
>> To: r-help at R-project.org
>> Tárgy: [R] Need Help!
>> Dear Sir/Madam,
>> I hope you will be fine. I am new to R language. Recently, I am trying to fit my data with one model.
>> I am sending you the code and image file on which you can see the error I am receiving instead of executing.
>> If I give a single value to parameter "ep", it executes well, but if I make a loop/seq for getting a range of data it shows
>> error.I need you help in solving this problem.
>> Thanking in advance,
>> With Best Regards,
>> Dawood
> 		 	   		  <Page1.png><Page2.png>______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list