extract

Extract standard errors from glm

五迷三道 提交于 2019-11-27 22:18:57
I did a glm and I just want to extract the standard errors of each coefficient. I saw on the internet the function se.coef() but it doesn't work, it returns "Error: could not find function "se.coef"" . The information you're after is stored in the coefficients object returned by summary() . You can extract it thusly: summary(glm.D93)$coefficients[, 2] #Example from ?glm counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) print(d.AD <- data.frame(treatment, outcome, counts)) glm.D93 <- glm(counts ~ outcome + treatment, family=poisson()) #coefficients has the data

Extract first word from a column and insert into new column [duplicate]

一曲冷凌霜 提交于 2019-11-27 22:10:59
问题 This question already has an answer here: Remove everything after space in string 4 answers I have a dataframe below and want to extract the first word and insert it into a new column Dataframe1: COL1 Nick K Jones Dave G Barros Matt H Smith Convert it to this: Dataframe2: COL1 COL2 Nick K Jones Nick Dave G Barros Dave Matt H Smith Matt 回答1: You can use a regex ( "([A-Za-z]+)" or "([[:alpha:]]+)" or "(\\w+)" ) to grab the first word Dataframe1$COL2 <- gsub("([A-Za-z]+).*", "\\1", Dataframe1

How do I programmatically extract the audio from a YouTube video? [closed]

会有一股神秘感。 提交于 2019-11-27 20:20:30
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I'm trying to create a C# application which allows me to extract just the audio from YouTube videos. I've come across sites that already do that, but I'm not sure how they actually work. What would be the best way to do this programmatically? Thanks for any advice 回答1: Writing an

How to extract frames of an animated GIF with PHP

冷暖自知 提交于 2019-11-27 20:17:26
I search for a long time how to extract frames from an animated GIF with PHP... unfortunaly I just found how to get their duration... I really need to extract the GIF frames and their duration to apply some resize, rotate, etc, on each and then to regenerate the GIF with edited frames ! I don't want to use any software, external library (like ImageMagick), just PHP: in fact I need to allow my class http://phpimageworkshop.com/ to work with animated GIF. If you have any idea, I'm listening you ^^ ! Sybio I spent my day creating a class based on this one to achieve what I wanted using only PHP!

PHP extract link from <a> tag [duplicate]

為{幸葍}努か 提交于 2019-11-27 20:14:55
Possible Duplicate: PHP String Manipulation: Extract hrefs I am using php and have string with content = <a href="www.something.com">Click here</a> I need to get rid of everything except "www.something.com" I assume this can be done with regular expressions. Any help is appreciated! Thank you This is very easy to do using SimpleXML: $a = new SimpleXMLElement('<a href="www.something.com">Click here</a>'); echo $a['href']; // will echo www.something.com Tails Give this a whirl: $link = '<a href="www.something.com">Click here</a>'; preg_match_all('/<a[^>]+href=([\'"])(?<href>.+?)\1[^>]*>/i',

Save tiff CCITTFaxDecode (from PDF page) using iText and Java

佐手、 提交于 2019-11-27 18:38:49
问题 I'm using iText to extract embedded images and save them as separate files. The .jpg and .png files come out ok, but I cannot extract tiff images that have the CCITTFaxDecode encoding. Does anyone have a way of saving the tiff files? I found some sample C# code that uses iTextSharp at Extracting image from PDF with /CCITTFaxDecode filter It indicates a separate tiff library is needed to write out the results. According to that article, the "CCITTFaxDecode" compression is Compression.CCITTFAX4

Java library for keywords extraction from input text

若如初见. 提交于 2019-11-27 18:00:56
I'm looking for a Java library to extract keywords from a block of text. The process should be as follows: stop word cleaning -> stemming -> searching for keywords based on English linguistics statistical information - meaning if a word appears more times in the text than in the English language in terms of probability than it's a keyword candidate. Is there a library that performs this task? sp00m Here is a possible solution using Apache Lucene . I didn't use the last version but the 3.6.2 one , since this is the one I know the best. Besides the /lucene-core-x.x.x.jar , don't forget to add

How to get the first word of a sentence in PHP?

a 夏天 提交于 2019-11-27 17:25:01
I want to extract the first word of a variable from a string. For example, take this input: <?php $myvalue = 'Test me more'; ?> The resultant output should be Test , which is the first word of the input. How can I do this? You can use the explode function as follows: $myvalue = 'Test me more'; $arr = explode(' ',trim($myvalue)); echo $arr[0]; // will print Test salathe There is a string function ( strtok ) which can be used to split a string into smaller strings ( tokens ) based on some separator(s). For the purposes of this thread, the first word (defined as anything before the first space

How to retrieve comments from within an XML Document in PHP

时间秒杀一切 提交于 2019-11-27 16:20:19
I want to extract all comments below a specific node within an XML document, using PHP. I have tried both the SimpleXML and DOMDocument methods, but I keep getting blank outputs. Is there a way to retrieve comments from within a document without having to resort to Regex? SimpleXML cannot handle comments, but the DOM extension can. Here's how you can extract all the comments. You just have to adapt the XPath expression to target the node you want. $doc = new DOMDocument; $doc->loadXML( '<doc> <node><!-- First node --></node> <node><!-- Second node --></node> </doc>' ); $xpath = new DOMXPath(

PHP String Manipulation: Extract hrefs

我是研究僧i 提交于 2019-11-27 16:07:10
I have a string of HTML that I would like to check to see if there are any links inside of it and, if so, extract them and put them in an array. I can do this in jQuery with the simplicity of its selectors but I cannot find the right methods to use in PHP. For example, the string may look like this: <h1>Doctors</h1> <a title="C - G" href="linkl.html">C - G</a> <a title="G - K" href="link2.html">G - K</a> <a title="K - M" href="link3.html">K - M</a> How (in PHP) can i turn it into an array that looks something like: [1]=>"link1.html" [2]=>"link2.html" [3]=>"link3.html" Thanks, Ian Russell Dias