similar to: Trouble with Functions

Displaying 20 results from an estimated 4000 matches similar to: "Trouble with Functions"

2012 Jun 14
1
how to export output
hello, I am using following command classify_polarity(documents,algorithm="bayes",verbose=TRUE) output is: [1] "DOCUMENT 1" [1] "WORD: excited CAT: positive POL: strongsubj SCORE: 8.44419229853175" [1] "WORD: happy CAT: positive POL: strongsubj SCORE: 8.44419229853175" [1] "WORD: optimistic CAT: positive POL: weaksubj SCORE: 7.7510451179718" [1]
2023 Jun 29
0
Processing a hierarchical string name
Ivan and Bert, thank you so much for your help. Ivan, your solution worked perfectly. I didn't really understand how to do string processing on a vector of strings, and your solution demonstrated it for me. I modified it to work with the tidyverses' stringr library in this way: bg3_race_sum <- bg3_race %>% left_join(pl_vars, by=c("variable" = "name"))
2013 Sep 27
2
Locating inefficient code
Hi, I have been using R for a few months and I have this working code. Don't seen any problem but this takes a long time. So if I have about 30000 rows it takes a few minutes. If I have 100000 it does not seem to complete. Original Data: Proto Recv-Q Send-Q Local-Address Foreign-Address State tcp 0 0 172.20.100.2:60255
2019 Sep 24
2
Consulta
Emilio Ahora cuando quiero instalar los paquetes pdftools, magick y otros más me salen el siguiente error WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ?C:/Users/bdominguez/Documents/R/win-library/3.6? (as ?lib?
2012 Jun 27
2
A solution for question about formatting Dates
Hello again: Here is a solution to the dates without leading zeros: pou1 <- function(x) { #Note: x is a data frame #Assume that Column 1 has the date #Column 2 has station #Column 3 has min #Column 4 has max library(stringr) w <- character(length=nrow(x)) z <- str_split(x[,1],"/") for(i in 1:nrow(x)) { u <-
2013 Apr 16
1
converting blank cells to NAs
You can use na.strings="" in read.table() or read.csv() library(stringr) vec1<-unlist(str_split(readLines(textConnection("3,7,11,,12,14,15,,17,18,19")),",")) ?vec1[vec1==""]<- NA ?vec1 # [1] "3"? "7"? "11" NA?? "12" "14" "15" NA?? "17" "18" "19" #or
2013 Apr 22
1
Print occurrence / positions of words
Hi, May be this helps: vec<- "this is a nice text with nice characters" library(stringr) ?vec2<-unlist(str_match_all(vec,"\\w+")) #or # vec2<-str_split(vec," ")[[1]] res<-unique(lapply(vec2,function(x) which(!is.na(match(vec2,x))))) ?names(res)<- unique(vec2) res #$this #[1] 1 # #$is #[1] 2 # #$a #[1] 3 # #$nice #[1] 4 7 # #$text #[1] 5 # #$with #[1]
2012 Nov 23
1
Sentiment analysis in R
Hi All, I am trying to perform sentiment analysis using R with the help of the library(sentiment). I am using the function classify_emotions(sentiment). It is basically selecting a particular word from a sentence and with the help of the pr-defined score of that particular word, it is giving the sentiment score of the whole sentence. For example,in the sentence "I am happy",
2019 Sep 23
5
Consulta
Buenas tarde a todo en s: Tenia la versión de R 3.6 y utilizaba la paquetería de pdftools para extraer información de archivos en pdf actualice la versión 3.6.1 y ya no reconoce la paquetería alguien que me pueda ayudar. Prácticamente no reconoce las funciones de pdftools library(pdftools) library(stringr)? library(NLP)? library(tm)? library(tesseract)? library(magick)?
2013 Apr 01
0
ggplot2 label problem
I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+ theme_bw() Thank you! the data used is:
2017 Jul 13
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Paul, No need to collapse the information into a single text string, gregexpr() can take a vector of strings (sentences in your case). You can split your sentences up, number them how you want, then search for your pattern either via regex or via these extra packages you use which probably use the PCRE regex library anyway. However, as this is basically what you did, I'm not sure why
2023 Dec 18
3
Function with large nested list
Hello list, I want to make a large rulebased algorithm, to provide decision support for drug prescriptions. I have defined the algorithm in a function, with a for loop and many if statements. The structure should be as follows: 1. Iterate over a list of drug names. For each drug: 2. Get some drug related data (external dataset). Row of a dataframe. 3. Check if adaptions should be made to
2013 Apr 01
0
ggplot2 label
Hello all! I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+ theme_bw() the data used is:
2013 Apr 01
0
ggplot label problem
Dear R users, I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+ theme_bw() the data used
2007 Apr 18
0
[Bridge] BCP code ported to pppd 2.4.2
Hello, i have ported the BCP (Bride Control Protocol) patch for pppd 2.4.1 mentioned in http://lists.osdl.org/pipermail/bridge/2004-September/000619.html to pppd 2.4.2. The kernel patch still works without problems with kernel 2.4.30. Perhaps someone else could use this patch ... Here again some documentation i have found about the BCP patch somewere else: When pppd negotiates BCP, it tells
2013 Apr 01
0
overlaping barplot
Hello all! I want to make a barplot with ggplot2. I want to view in the same chart the semn values (significant values (pointer over 50)). I try this code, but only for pointer values. ggplot(data, aes(x = Year, y = pointer)) + geom_bar(stat="identity") please help me with this problem. I use this data: Year variable pointer variable semn 1 1901 neg 0.00 sneg NA 2 1902 neg 0.00 sneg
2010 Nov 25
0
[libsvm] predict function error
Dear R users, There is a error message when I run the following code. It is used to load microarray data and use the top 1000 genes for training svm to classify test set . > library(e1071) Loading required package: class > f=read.table("F:\\lab\\ microarray analysis\\VEH LPS\\exprs.txt",
2005 Nov 10
2
ltext - adding text to each panel from a matrix
Hi all (really probably just Deepayan): In the plot below I want to add text on either side of each violin plot that indicates the number of observations that are either positive or negative. I'm trying to do this with ltext() and I've also monkeyed about with panel.text(). The code below is generally what I want but my calls to ltext() are wrong and I'm not sure how to fix them.
2013 Jun 08
1
splitting a string column into multiple columns faster
Hello! I have a column in my data frame that I have to split: I have to distill the numbers from the text. Below is my example and my solution. x<-data.frame(x=c("aaa1_bbb1_ccc3","aaa2_bbb3_ccc2","aaa3_bbb2_ccc1")) x library(stringr) out<-as.data.frame(str_split_fixed(x$x,"aaa",2)) out2<-as.data.frame(str_split_fixed(out$V2,"_bbb",2))
2024 Mar 20
1
geom_edge & color
Dear community I am using ggraph to plot a network analysis. See part 2 in the working example. Besides different colors for different groups of nodes: --> geom_node_point(aes(size = V(network)$hub_score*200, color= as.factor(V(network)$community))) I additionally want to consider different colors for different edge groups The grouping is defined in the edge_list$relationship: negative