You can try noquote also:
noquote(paste('abc', '"xyz"', sep = ""))
On Wed, Jun 30, 2010 at 3:31 PM, Paul Evans wrote:
> Hi,
>
> How can I get double quotes embedded in the string?
>
> Example:
>
> --
> str1 <- '"xyz"'
>
> ## desired output
> # abc"xyz"
>
> qr2 <- paste('abc',str1,s
cat() is probably what you want, but note that print()
has a 'quote=' argument that you could set to FALSE:
print(qr2, quote = FALSE)
See ?print.default
-Peter Ehlers
On 2010-06-30 13:16, Phil Spector wrote:
Paul -
When you print a string, it escapes the quotes with a backslash. That's
a
Paul -
When you print a string, it escapes the quotes with a
backslash. That's a property of the print() function,
not the string itself.
If you want to see the string, use cat(). The nchar()
function is also useful:
str1 <- '"xyz"'
qr2 <- paste('abc',str1,sep='')
print(qr2)
[1] "abc\
Knut Krueger wrote:
Will this do?
temp <- paste("m", 1:3, sep="",collapse=",")
Unfortunately not, because I explained the example not detailed enough.
The string could have different Items, like November, December, Monday,
Tuesday, Daylight and so on
Therefore I must count the Items of t
On Wed, Dec 23, 2009 at 11:21 AM, Knut Krueger wrote:
> Hi to all
>
> I need a string like
> temp <- paste("m1","m2","m3",sep=",")
> But i must know how many items are in the string,afterwards
> the other option would be to use a vector
> temp <- c("m1","m2","m3")
> No problem to get the count of
Hi
r-help-boun...@r-project.org napsal dne 23.12.2009 12:08:02:
> Jim Lemon schrieb:
> >
> > Not as easy as I thought it would be, but:
> >
> > mlist<-as.list(paste("m",1:sample(5:10,1),sep=""))
> > do.call("paste",c(mlist,sep=","))
> >
>
> Hi Jim,
> yes it works :-)
>
> temp <- c("November",
Hi Baptiste,
Isn't paste doing exactly this?
yes indeed - surprising
temp <- c("November", "December","Monday","Tuesday")
paste(temp, collapse=",")
paste(temp, sep=",") I tried to use sep :-(
Arguments
|...| one or more *R* objects, to be converted to character vectors.
|sep|
On 23-Dec-09 11:40:12, baptiste auguie wrote:
> Isn't paste doing exactly this?
>
> temp <- c("November", "December","Monday","Tuesday")
> paste(temp, collapse=",")
># "November,December,Monday,Tuesday"
>
> HTH,
> baptiste
Yes, spot-on! I got involved in the confusion resulting from
the use of "
Isn't paste doing exactly this?
temp <- c("November", "December","Monday","Tuesday")
paste(temp, collapse=",")
# "November,December,Monday,Tuesday"
HTH,
baptiste
2009/12/23 Ted Harding :
> On 23-Dec-09 11:08:02, Knut Krueger wrote:
>> Jim Lemon schrieb:
>>> Not as easy as I thought it would be
On 23-Dec-09 11:08:02, Knut Krueger wrote:
> Jim Lemon schrieb:
>> Not as easy as I thought it would be, but:
>>
>> mlist<-as.list(paste("m",1:sample(5:10,1),sep=""))
>> do.call("paste",c(mlist,sep=","))
>
> Hi Jim,
> yes it works :-)
>
> temp <- c("November", "December","Monday","Tuesday")
> le
Jim Lemon schrieb:
Not as easy as I thought it would be, but:
mlist<-as.list(paste("m",1:sample(5:10,1),sep=""))
do.call("paste",c(mlist,sep=","))
Hi Jim,
yes it works :-)
temp <- c("November", "December","Monday","Tuesday")
length(temp) #getting the length of the vector
string1=do.call("p
Hi
r-help-boun...@r-project.org napsal dne 23.12.2009 11:46:31:
>
> > Will this do?
> >
> > temp <- paste("m", 1:3, sep="",collapse=",")
> >
> >
> Unfortunately not, because I explained the example not detailed enough.
> The string could have different Items, like November, December, Monday,
On 12/23/2009 09:21 PM, Knut Krueger wrote:
Hi to all
I need a string like
temp <- paste("m1","m2","m3",sep=",")
But i must know how many items are in the string,afterwards
the other option would be to use a vector
temp <- c("m1","m2","m3")
No problem to get the count of items but I must get aft
Will this do?
temp <- paste("m", 1:3, sep="",collapse=",")
Unfortunately not, because I explained the example not detailed enough.
The string could have different Items, like November, December, Monday,
Tuesday, Daylight and so on
Therefore I must count the Items of the string separated b
Will this do?
temp <- paste("m", 1:3, sep="",collapse=",")
HTH,
baptiste
2009/12/23 Knut Krueger :
> Hi to all
>
> I need a string like
> temp <- paste("m1","m2","m3",sep=",")
> But i must know how many items are in the string,afterwards
> the other option would be to use a vector
> temp <- c("
15 matches
Mail list logo