Displaying 20 results from an estimated 20000 matches similar to: "Improving string concatenation"
2015 Jun 17
4
Improving string concatenation
Bad choice of words I'm afraid. What I'm ultimately pushing for is a
feature request. To allow string concatenation with '+' by default. Sure I
can write my own string addition function (like the example I posted
previously) but I use it so often that I end up putting it in every script
I write.
It is ultimately a matter of readability and syntactic sugar I guess. As an
example, I
2015 Jun 17
3
Improving string concatenation
On Tue, Jun 16, 2015 at 8:24 PM, Herv? Pag?s <hpages at fredhutch.org> wrote:
[...]
>
> If I was to override `+` to concatenate strings, I would make it stick
> to the recycling scheme used by arithmetic and comparison operators
> (which is the most sensible of all IMO).
Yeah, I agree, paste's recycling rules are sometimes painful. This
could be "fixed" with a nice
2015 Jun 17
2
Improving string concatenation
> How would this new '+' deal with factors, as paste does or as the current
'+'
> does? Would number+string and string+number cause errors (as in current
> '+' in R and python) or coerce both to strings (as in current R:paste and
in perl's '+').
I had posted this sample code previously to demonstrate how string
concatenation could be implemented
2015 Jun 17
0
Improving string concatenation
Hi Joshua,
On 06/16/2015 03:32 PM, Joshua Bradley wrote:
> Hi, first time poster here. During my time using R, I have always found
> string concatenation to be (what I feel is) unnecessarily complicated by
> requiring the use of the paste() or similar commands.
>
>
> When searching for how to concatenate strings in R, several top search
> results show answers that say to
2015 Jun 17
0
Improving string concatenation
> ... adding the ability to concat
> strings with '+' would be a relatively simple addition (no pun intended)
to
> the code base I believe. With a lot of other languages supporting this
kind
> of concatenation, this is what surprised me most when first learning R.
Wow! R has a lot of surprising features and I would have thought
this would be quite a way down the list.
How
2015 Jun 17
0
Improving string concatenation
On Jun 16, 2015 3:44 PM, "Joshua Bradley" <jgbradley1 at gmail.com> wrote:
>
> Hi, first time poster here. During my time using R, I have always found
> string concatenation to be (what I feel is) unnecessarily complicated by
> requiring the use of the paste() or similar commands.
I don't follow. In what sense is paste complicated to use? Not in the sense
of
2015 Jun 18
1
Improving string concatenation
Gabor Csardi writes:
> Btw. for some motivation, here is a (surely incomplete) list of
> languages with '+' as the string concatenation operator:
>
> ALGOL 68, BASIC, C++, C#, Cobra, Pascal, Object Pascal, Eiffel, Go,
> JavaScript, Java, Python, Turing, Ruby, Windows Powers hell,
> Objective-C, F#, Sc-ala, Ya.
The situation for R is rather different from that of a
2015 Jun 17
1
Improving string concatenation
Just to clarify, primitive (C-level) generics do not support dispatch
on basic classes (like character). This is for performance (no need to
consider dispatch on non-objects) and for sanity (in general,
redefining fundamental behaviors is dangerous). It is of course
possible to define a "+" method with a signature containing a class
not in the set of basic classes.
On Tue, Jun 16, 2015
2015 Jun 17
3
Improving string concatenation
On Wed, Jun 17, 2015 at 12:45 PM, William Dunlap <wdunlap at tibco.com> wrote:
>> ... adding the ability to concat
>> strings with '+' would be a relatively simple addition (no pun intended)
> to
>> the code base I believe. With a lot of other languages supporting this
> kind
>> of concatenation, this is what surprised me most when first learning R.
>
2012 Sep 14
4
concatenating two vectors
Dear all,
I want to concatenate the elements of two vectors such as
a<-c("a1","a2")
b<-c("b1","b2")
and obtain
"a1b1", "a1b2","a2b1","a2b2"
I tried the paste and paste0 functions, but they yielded elementwise
concatenation such as
"a1b1","a2b2"
I am wondering that is there an efficient
2015 Jun 17
0
Improving string concatenation
One of the poster's on the SO post I linked to previously suggested this
but if '+' were made to be S4 compliant, then adding the ability to concat
strings with '+' would be a relatively simple addition (no pun intended) to
the code base I believe. With a lot of other languages supporting this kind
of concatenation, this is what surprised me most when first learning R.
This is
2015 Jun 17
0
Improving string concatenation
if '+' and paste don't change their behavior with respect to
factors but you encourage people to use '+' instead of paste
then you will run into problems with data.frame columns because
many people don't notice whether a character-like column is
character or factor. With paste() this is not a problem but with '+'
it is. I think it is good not to make people worry
2019 Nov 08
8
improving the performance of install.packages
I could do this...and I have before. This brings up a more fundamental
question though. You're asking me to write code that changes the logic of
the installation process (i.e. writing my own package installer). Instead
of doing that, I would rather integrate that logic into R itself to improve
the baseline installation process. This api proposal change would be
additive and would not break
2018 Jan 24
2
Issue with concatenation of URL losing
Thank you for your help in advance.
I am trying to pull some data back from a web service
library(httr)
sample2 <- GET("https://elevation.mapzen.com/height?json={\"range\":false,\"shape\":[{\"lat\":40.7,\"lon\":-76.5}]}&api_key=mycode")
result2 <- content(sample2)
height <- result2$height[[1]]
I would like to put by own latitude
2018 Jan 24
0
Issue with concatenation of URL losing
a) you need to read the help pages on the paste function... more likely
you are looking for the paste0 function because extra spaces will most
likely break the GET request format.
b) quotes do not become "stuck" as \" ... that is a visual representation
intended to clarify that that quote is not terminating the string but is
actually part of it. If you want to see the contents
2006 Feb 13
7
Concatenation
I have this:
<%= @tech_standard.category + " " + @tech_standard.point + "." +
@tech_standard.subpoint %>
I get this error:
cannot convert Fixnum into String
point and subpoint are number.
How do I concatenate those values?
Seth Buntin
Web Resources Coordinator
Kentucky Academy of Technology Education
Murray State University
--------------
2019 Nov 08
3
improving the performance of install.packages
Hello,
Currently if you install a package twice:
install.packages("testit")
install.packages("testit")
R will build the package from source (depending on what OS you're using)
twice by default. This becomes especially burdensome when people are using
big packages (i.e. lots of depends) and someone has a script with:
install.packages("tidyverse")
...
... later
2019 Nov 08
4
improving the performance of install.packages
Hi Gabe,
Keeping track of where a package was installed from would be a nice
feature. However it wouldn't be as reliable as comparing hashes to
decide whether a package needs re-installation or not.
H.
On 11/8/19 12:37, Gabriel Becker wrote:
> Hi Josh,
>
> There are a few issues I can think of with this. The primary one is that
> CRAN(/Bioconductor) is not the only place one
2016 Apr 28
0
Create a new variable and concatenation inside a "for" loop
Maybe I wasn't clear about my query.
I'm very familiar with pre-allocation and vectorization and I had already wrote an R code for this problem in this way. My question wasn't about the most efficient way to solve the problem. It was about whether in R it was possible to use the same index used in the loop to create a new variable and store the results in as in the example showed
2009 Sep 30
4
How do I do simple string concatenation in R?
Dear R gurus
How do I do simple string concatenation in R?
For example:
A = "klm"
B = "jjj"
How can I assign a value to C such that C == "klmjjj" is True?
Thank you
Arie
[[alternative HTML version deleted]]