[R] Help with a function and text

David Winsemius dwinsemius at comcast.net
Thu Mar 7 05:46:20 CET 2013


On Mar 6, 2013, at 3:44 PM, Eliano wrote:

> Thanks. Btw are you able to help with my issue? Thanks, Eliano

I'm sorry, .... I was too busy answering the question from 'Eliano' over on StackOverflow. I didn't have time to address this one.

(Please do note that cross-posting questions to Rhelp is contrary to advice in the Posting Guide.)

You might also do further searching in the Archives with the search terms: substitute text eval 
.... and perhaps narrow it down further with contributors named: grothendeick, dunlap, ligges, venables

> 
> Sent from my iPhone
> 
> On 6 Mar 2013, at 23:41, "David Winsemius [via R]" <
> ml-node+s789695n4660547h26 at n4.nabble.com> wrote:
> 
> 
> On Mar 6, 2013, at 11:25 AM, Eliano Marques wrote:
> 
>> Hi, can I understand why this message was rejected ?
>> Thanks,
>> Eliano
> 
> First hit on a Markmail search:
> 
> http://markmail.org/message/5xog3ayx4amprsdx?q=list:org%2Er-project%2Er-help+nabble+rejected
> 
> -- 
> David.
> 
>> 
>> Sent from my iPhone
>> 
>> On 6 Mar 2013, at 19:18, Eliano <[hidden email]</user/SendEmail.jtp?type=node&node=4660547&i=0>>
> wrote:
>> 
>>> Hi everyone,
>>> 
>>> I am writing some code to generate a function. I am passing that code to
> a
>>> dataset which i'm importing in R, e.g.
>>> Test=read.table('C:/test.txt', header=F, sep='\t', na.strings='NA',
> dec='.',
>>> strip.white=TRUE)
>>> Test
>>> 
>>> V1
>>> (if(nclusters>0){OptmizationInputs[3,3]*beta[1]}else{0})+"
>>> (if(nclusters>1){OptmizationInputs[3,3]*beta[1]}else{0})+"
>>> V1 has inside a code for a function.
>>> 
>>> I'm having problems with 2 things:
>>> 
>>> 1 - I need to take out from V1 all " that appears in the text, i tried a
>>> replace but did not work.
>>> Test=replace(Test,' " ', ' ')  , did not work.
>>> 
>>> 2 - Writing a function like this :
>>> 
>>> nlog=function(par)
>>>      {
>>>      beta=par[1:n]
>>>      Measure=Test[1]  # would this read the text?
>>>      return(Measure)
>>>      }
>>> 
>>> So i need to use that code inside the function as above.
>>> Any suggestion on how you would do this?
>>> 
>>> Kind Regards,
>>> Eliano
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
> http://r.789695.n4.nabble.com/Help-with-a-function-and-text-tp4660523.html
>>> Sent from the R help mailing list archive at Nabble.com.
>>> 
>> 
>> ______________________________________________
>> [hidden email] </user/SendEmail.jtp?type=node&node=4660547&i=1> 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 commented, minimal, self-contained, reproducible code.
> 
> David Winsemius
> Alameda, CA, USA
> 
> ______________________________________________
> [hidden email] </user/SendEmail.jtp?type=node&node=4660547&i=2> 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 commented, minimal, self-contained, reproducible code.
> 
> 
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://r.789695.n4.nabble.com/Help-with-a-function-and-text-tp4660523p4660547.html
> To unsubscribe from Help with a function and text, click
> here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660523&code=ZWxpYW5vLm0ubWFycXVlc0BnbWFpbC5jb218NDY2MDUyM3wtMTk0ODk5MDYy>
> .
> NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Help-with-a-function-and-text-tp4660523p4660548.html
> Sent from the R help mailing list archive at Nabble.com.
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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 commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list