Displaying 20 results from an estimated 11000 matches similar to: "pasting "\" into character strings"
2003 Apr 02
19
Combining the components of a character vector
Dear Help,
Suppose I have a character vector.
x <- c("Bob", "loves", "Sally")
I want to combine it into a single string: "Bob loves Sally" .
paste(x) yields:
paste(x)
[1] "Bob" "loves" "Sally"
The following function combines the character vector into a string in the
way that I want, but it seems somewhat inelegant.
2006 Feb 24
2
converting character matrix to a dataframe
Dear R-Help,
Suppose I have a character matrix, e.g.,
(ch.mat <- matrix(c('a','s','*','f','w','*','k','*','*','f','i','o'),
ncol=3))
When I convert 'ch.mat' to a dataframe, the columns are converted to
factors:
(d1 <- data.frame(ch.mat))
mode(d1[,1])
is.factor(d1[,1])
To prevent
2002 Dec 20
2
vectorizing test for equality
Dear R Help,
I am trying to create a boolean vector that is TRUE whenever a
particular value occurs in a numeric vector, and FALSE otherwise. For
example, suppose that
> y <- c(5, 2, 4, 3, 1)
> y
[1] 5 2 4 3 1
and suppose that I want to find where 3 occurs in y. Then, the following
yields the solution:
> y == 3
[1] FALSE FALSE FALSE TRUE FALSE
My problem arises when the
2002 Apr 23
3
Subsetting by a logical condition and NA's
I have run into a general problem with subsetting of which the following
is a simple example. Suppose that
x <- c(5, NA, 7, 5, NA, 3)
y <- c(1, 2, 3, 4, 5, 6)
I want to extract the values of y for which x = 5, but y[x==5] yields
> y[x==5]
[1] 1 NA 4 NA
I find that y[!is.na(x) & x==5] yields the desired result:
> y[!is.na(x) & x==5]
[1] 1 4
but I am wondering whether
2003 Mar 22
1
extracting the names of the dataframe and variables in aov or lm
Dear R Users,
I want to write a function that applies to the dataframe and variables
that were used in a previous call to lm or aov. In order to do this, I
need to write a function that applies to the output of lm or aov, and
yields the names of the dataframe and variables that were used in the lm
or aov analysis.
For example, suppose that I give the command:
aov.out <- aov( Rt ~
2002 Apr 19
4
Multidimensional scaling
A student of mine wants to use R to do some nonmetric multidimensional
scaling. According to the R FAQ, there's a package called pcurve that
computes multidimensional scaling solutions, but I was not able to locate
it the contrib page (I am a Windows user with R version 1.4.1). Can
anyone tell me whether it is possible to do nonmetric multidimensional
scaling with R, and if so, how?
John
2001 Oct 31
3
t.test
Dear R-users,
I am learning to use R 1.3.1 on a Pentium running Windows '98. I'm
puzzled that several statistical procedures, t.test and chisq.test, do not
appear to be available on R version 1.3.1. For example, if I type
"t.test", I get the reply, "Object "t.test" not found". Is there a
package that I have to load in order to have access to these
2002 Oct 10
2
Environment variables under Windows
Greetings,
I have a question pertaining to the concept of "environment variables"
that is mentioned in the R documentation for "Startup" and also in the
discussion of the Windows configuration of R in the recent book "An
Introduction to R" authored by Venables, Smith, and the R Development Core
Team (referred to as VS in this message).
The Startup documentation and
2003 Oct 14
0
Job notice at the University of Washington
UNIVERSITY OF WASHINGTON
FACULTY POSITION IN QUANTITATIVE PSYCHOLOGY
The Department of Psychology seeks to fill a position in Quantitative
Psychology at the tenure-track assistant professor level. In exceptional
circumstances, appointment at the Associate Professor or Professor level
may be considered for candidates who offer extraordinary opportunities to
further the University's
2002 Apr 23
0
Summary: Multidimensional scaling
I sent a query to R-Help about the availability of nonmetric
multidimensional scaling (MDS) algorithms in R. I would like to thank
Tony Rossini, Jonathan Baron, Sundar Dorai-Raj, and Brian Ripley for
helpful replies. The gist of the replies is that isoMDS in the MASS
library provides Kruskal's method for nonmetric MDS, sammon in the MASS
library provides Sammon's nonlinear mapping method
2004 Apr 05
0
studentized deleted residuals and NA's
Dear R-Help,
I am using the studres function from the MASS package to compute
studentized deleted residuals in a oneway anova. I'm having trouble
interpreting the results in situations where a factor level has only one
observation. Sometimes studres yields an NaN and sometimes it produces a
numeric value for cases where a factor level has only one observation. I
would think it should
2008 Jun 23
2
Pairwise Partitioning of a Vector
Hi,
How can I partitioned an example vector like this
> print(myvector)
[1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9
into the following pairwise partition:
PAIR1
part1 = 30.9
part2 = 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9
PAIR2
part1 = 30.9 60.1
part2 = 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9
....
PAIR9
part1 = 30.9
2008 Jun 23
1
How to access data structure (List of List)
Hi,
I have this kind of output.
> str(nw)
List of 3
$ :List of 2
..$ part1: num 30.9
..$ part2: num [1:78] 60.1 70.0 73.0 75.0 83.9 ...
$ :List of 2
..$ part1: num [1:2] 30.9 60.1
..$ part2: num [1:77] 70.0 73.0 75.0 83.9 93.1 ...
$ :List of 2
..$ part1: num [1:3] 30.9 60.1 70
..$ part2: num [1:76] 73.0 75.0 83.9 93.1 97.6 ...
My question are:
1. What kind of data structure
2009 Nov 01
2
CentOS Mirrored On RapidShare [Links Here]
Hey List,
Firstly I am sorry for the length of this email and that you are all
having too receive it but the point is that this email will now go
into the archive and be indexed by Google (hopefully) and thusly,
people will be able to find these links through Google. My goal is to
mirror CentOS on RapidShare. "Why you fool there are loads of
mirrors?" you might ask; simply for
2008 Mar 20
2
[LLVMdev] arm code generation
Hello,
I'm trying to do the following and encountering problems with the
generated arm assembly code:
I've got an application in two parts that i've compiled into llvm
bitcode using:
llvm-gcc -emit-llvm -c part1.c -o part1.bc
llvm-gcc -emit-llvm -c part2.c -o part2.bc
Then I link them together:
llvm-ld part1.bc part2.bc -o combined.bc
Now I use the ARM backend via llc to
2010 Aug 01
3
Constructing arguments for plotmath
Colleagues,
I am encountering difficulty adding formatted text to a graphic. Specifically, I want to add a superscript in the middle of a text string but I would like to format the text string on the fly. The commands:
plot(1,1)
ARG <- bquote('TEXT'^'\u00ae')
mtext(ARG, line=-2, side=1)
yield the desired output.
However, my goal is to paste together a string, then pass
2008 Sep 02
1
R Newbie: quantmod and zoo: Warning in rbind.zoo(...) : column names differ
Hello;
I am trying following but getting a warning message : Warning in
rbind.zoo(...) : column names differ, no matter whatever I do.
Also I do not want to specify column names manually, since I am just
writing a wrapper function around getSymbols to get chunks of data
from various sources - oanda, dividends etc.
I tried giving col.names = T/F, header = T/F and skip = 1 but no help.
I think
2012 Apr 13
5
Merging two data frames with different columns names
I am trying to merge two data frames, but one of the column headings are
different in the two frames. How can I rjoin or rbind the tho frames?
Johnny
# Generate 2 blocks by confounding on abc
d1 <- conf.design(c(1,1,1), p=2, block.name="blk", treatment.names =
c("A","B","C"))
d2 <- conf.design(c(1,1,1), p=2, block.name="blk",
2012 May 14
4
Data read as labels
Hey guys,
i have a strange problem reading a .csv file.
Seems not to be covered by the usual read.csv techniques.
The relevant data i want to use, seems to be saved as the label of the data
point.
Therefore i can not really use it
spec<-"EU2001"
2011 Jan 27
1
Errors in Integrate
Hello,
I have written the function I would like to integrate in two ways:
denfxn <- function(yy,vv,a2,b2,mu2) {
pp <- 1-pnorm(yy/sqrt(vv))
part1 <- pp^(a2-1)
part2 <- (1-pp)^(b2-1)
part3 <- dnorm(yy,mu2,sqrt(vv))
return(part1*part2*part3) }
denfxnorg <- function(yy,vv,a2,b2,mu2) {
pp <- 1-pnorm(yy/sqrt(vv))
pp <- if (pp < .001) .001
else