similar to: Quotes inside char string

Displaying 20 results from an estimated 40000 matches similar to: "Quotes inside char string"

2011 Oct 03
2
read .csv from web from password protected site
I am very new to R and have been struggling trying to read a basic ".csv" file from a password protected site with the following code: myURL ="http://www.frontierweather.com/degreedays/L15N15PowerRegionAverages_10weeks.txt" test2=read.table(url(myURL),header=TRUE,sep=",") A 'data.frame' is returned into the workspace, however it is not the data contained in
2003 Sep 12
1
Getting 2 kinds of quotes inside a pasted string
Hi, all. I would like to use "pipe" to run a file through an awk program before scanning (to reduce the amount of data I'll be taking in). I would like to construct the awk program in R, and also to be able to set the awk variable FS, to accommodate different field separators in different files. My problem is that I keep getting the quotes escaped in the string that comes out, and
2011 Dec 20
1
RODBC Error: 'getCharCE' must be called on a CHARSXP
I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code: channel <-odbcConnect("some_dsn", uid="", pwd="") txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"' sqlQuery(channel, cat(txt,"\n"),errors=TRUE,) close(channel) However, I get the
2012 May 12
1
problem with get() inside of lme()
Hi, In the following lines of code are inside of a function, where "TRAIT1" is a function variable calling a column-name inside of the data.frame "new3". This works just fine: m2 <- lmer(get(TRAIT1) ~ perm.score + (1|site), data=new3) but this will not work, m3 <- lme(get(TRAIT1) ~ perm.score , random= ~1|site, data=new3) I get the following error: Error in
2006 Jul 20
2
Timing benefits of mapply() vs. for loop was: Wrap a loop inside a function
List: Thank you for the replies to my post yesterday. Gabor and Phil also gave useful replies on how to improve the function by relying on mapply rather than the explicit for loop. In general, I try and use the family of apply functions rather than the looping constructs such as for, while etc as a matter of practice. However, it seems the mapply function in this case is slower (in terms of CPU
2006 Jul 19
4
Wrap a loop inside a function
I need to wrap a loop inside a function and am having a small bit of difficulty getting the results I need. Below is a replicable example. # define functions pcm <- function(theta,d,score){ exp(rowSums(outer(theta,d[1:score],'-')))/ apply(exp(apply(outer(theta,d, '-'), 1, cumsum)), 2, sum) } foo <- function(theta,items, score){ like.mat <-
2012 Apr 20
1
pasting a formula string with double quotes in it
Hello everyone, I have tried several ways of doing this and searched the documentation and help lists and I have been unable to find an answer or even whether it is possible to do it. I am pasting together a formula and I need to insert double quotes around the strings. Here's an example: location <- c("AL", "AK", "MA", "PA") v=2 test <-
2007 Aug 23
4
scoring problem in acts_as_ferret
Hi, I am using acts_as_ferret and have a problem with scoring. I would like to organize it in such way that, if any of the searched terms fits, I get 1.0 score as a result. I will explain it on the example. I have in index: a) "one two three four" b) "one two three" c) "one two" d) "one" When I search for "one" I would like to get 1.0 score for
2010 May 07
1
writing string values from a matrix to a file without enclosing quotes
I am trying to format data for the Geneland package I need to write a series of paired numbers and paired "000" to a plain ascii file without surrounding the numerals with quotes, the original data is in a matrix formatted paired strings, and written to file using write.table(x,"output filename",col.names=F,row.names=F) thus "77 79" "132 132" "000
2012 Mar 20
1
Remove quotes from a string to use in a variable call
Hi, I have a string that I want to use in a variable call. How can I remove the quotes and/or the string properties of the string to use it in a variable call? Here's an example: library(lme) fm2 <- lme(distance ~ age, data = Orthodont, random = ~ 1) summary(fm2) I want to update the above regression to include new predictors according to what is in a string: predictors <-
2006 Mar 31
6
string interpolation - #{} vs. single vs. double quotes
Could someone point me to documentation that provides a succinct and accurate description of the difference between interpolation using #{}, single quotes, and double quotes ? I imagine there''s a set of precedence rules that govern behavior if/when they''re mixed. I''d like to get clear on this. Thanks, Bill -------------- next part -------------- An HTML attachment was
2007 Dec 25
1
Does sort work for strings work?
Hi, I am trying to get sorting working. I have had success with numbers but when I try to sort my string fields nothing happens. I am using the following code: options = {} s = Search::SortField.new(''object_title'', :reverse => false) options[:sort] = s @index.search_each("my query",options) do |id, score| puts "-->Document #{id} found with a
2005 Jan 05
3
Tuning string matching
Dear list, I spent about two hours searching on the message archive, with no avail. I have a list of people that have to pass an on-line test, but only a fraction of them do it. Moreover, as they input their names, the resulting string do not always match the names I have in my database. I would like to do two things: 1. Match any strings that are 90% the same Example: name1 <- "Harry
2008 Jul 03
2
How do I paste double quotes arround a character string?
Hi R Community: I've got a character string that looks like: New Mexico How to I create the new character string that looks like: "New Mexico" That is, it is the original string (New Mexico) with double quotes infront and behind it? Thanks, Phil Smith
2012 Nov 29
4
splitting a string by space except when contained within quotes
I've been trying to split a space delimited string with double-quotes in R for some time but without success. An example of a string is as follows: /rainfall snowfall "Channel storage" "Rivulet storage"/ It's important for us because these are column headings that must match the subsequent data. Here is some code I've been trying: str <- 'rainfall
2010 Aug 26
3
Passing data to aov
Hello Again Gurus and Lurkers: I?m trying to build a very user-friendly function which does aov without having the user type in a formula (which would be tedious in this case). The idea is to take the response from a PCA score matrix, and the factors from a list. A simple example is the function given below, along with test data and a sample call to the function. I'm certainly having
2011 Oct 09
1
help with using last observation carried forward analysis for a clinical trial please
Hi, I have a series of id's with multiple visits and questionnaire scores. This is a clinical trial that will be analyzed using the last observation carried forward method. In other words, in order to comply with intent to treat analysis when many subjects withdraw, data points for the last visit must be generated and filled in with the last observation. The ultimate goal is to tabulate the
2007 Dec 16
4
improving a bar graph
Hello, Below is the code for a basic bar graph. I was seeking advice regarding the following: (a) For each time period there are values from 16 people. How I can change the colour value so that each person has a different colour, which recurs across each of the three graphs/tie epriods? (b) I have seen much more sophisticated examples using lattice (e.g each person has a separate
2011 Apr 28
3
Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test
Hi there, I am trying to do multiple pairwise Wilcoxon signed rank tests in a manner similar to: a <- c(runif(1000, min=1,max=50), rnorm(1000, 50), rnorm(1000, 49.9, 0.5), rgeom(1000, 0.5)) b <- c(rep("group_a", 1000), rep("group_b", 1000), rep("group_c", 1000), rep("group_d", 1000)) pairwise.wilcox.test(a, b, alternative="two.sided",
2007 Sep 28
1
Selecting values
Hello all, An elementary question that I am sure can be easily cracked by an R enthusiast. Let's say I have multiple scores (y) on subjects (x.sample). Some subjects have a few more scores than others. Can somebody suggest some code that will select the first score for each subject? For example, the following code generates scores for 5 subjects: > x <- c(1:5) > x.sample <-