...or, when trying to read it back into R,
read.csv(header = TRUE, text = '
"no good","no good at all"
1,4
2,5
3,6')
no.good no.good.at.all
1 1 4
2 2 5
3 3 6
read.csv(header = TRUE, check.names = FALSE, text = '
"no good","no good at al
Hi Dan,
I don't get this behavior with R-3.2.2:
da.df<-data.frame(1:3,4:6)
names(da.df)<-c("no good","no good at all")
> da.df
no good no good at all
1 1 4
2 2 5
3 3 6
write.csv(da.df,file="gloop.csv",row.names=FALSE)
gives me this:
"no
Reproducible example, please.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Pl
Hi all,
I have a number of columns with spaces in the column names exactly as
I want them in R. When I go to export the data table to csv using
write.csv(), the fn adds periods in place of the spaces.
Is there a way to suppress the addition of the periods?
Thanks,
Dan
_
Does this get you started?
f<-function(t,cx){
(abs(t-cx)*(t >= cx)+10*abs(t-cx)*(t < cx))*dbeta(t,1.05,30)
}
integrate(f,lower=0,upper=1,cx=0.4)$val # e.g., for c = 0.4
The "integrate" function integrates over the first parameter. Other
parameters can be entered as needed.
[Note: I used cx as
I think this behavior is consistent with typical indexing behaviour in R... I
would ask you what result you thought you should get? I, for one, can think of
all sorts of uses for numeric indexes that have different lengths than the
vector, but am stumped to think of any use for what you are prop
length(post) is 1 (i.e., it is just a single function), but length(post(t))
== length(t)
--
View this message in context:
http://r.789695.n4.nabble.com/Plots-Help-tp4711894p4711897.html
Sent from the R help mailing list archive at Nabble.com.
__
R-he
As written, the code does not run because you are trying to plot post vs. t.
Try instead:
plot(t, post(t)), or, more simply, plot(t, dbeta(t,1.05,30))
-Dan
--
View this message in context:
http://r.789695.n4.nabble.com/Plots-Help-tp4711894p4711896.html
Sent from the R help mailing list archive
# your data
VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black")
# declare the new vector
New_Vector<-numeric(length(VAS))
# brute force:
New_Vector[VAS=="White"]<-1
New_Vector[VAS=="Yellow"]<-2
New_Vector[VAS=="Green"]<-3
New_Vector[VAS=="Black"]<-4
# a litt
I came across this behavior when I followed the code of function 'rank' in R.
It seems that subassignment of a vector by a logical index vector that is
longer than the original vector always results in expanding the original vector
to the length of the index vector.
The resulting length may be
Dear Stephen,
I was the new R user having trouble "with Windows 10", but it turns out my
issues were due to saving the workspace, rather than anything to do with
Windows 10. That problem is now sorted and so far all looks good.
HTH, Joyaa
John Fox wrote
> I can confirm that I'm using R 3.2.2
Thanks, Jim!
The lack of quotes was a typo, but what was not was my forgetting to
include the "c(" function... Thanks!
On Sat, Sep 5, 2015 at 7:23 AM, Jim Lemon wrote:
> Hi Nick,
> If you haven't just made a typo on your example in QUESTION 2, the "This
> doesn't" line should read:
>
> cronba
Der JWD, Dear Jeff Newmiller,
Many thanks for your useful advice. JWD - I have notepad++ and I don't
know why I didn't think of that! Having said that, I will take a look at
RStudio that John mentions too.
Thanks again. Much appreciated. Joyaa
-Original Message-
From: jwd
Dear John,
You mention, "the Rcmdr manual (accessible via "Help > Introduction to the R
Commander")".
Apologies for my dumbness, but the manual I did read - and found helpful -
before posting is clearly a different one. A 43 page pdf with no section
numbers nor any reference to the Worksp
Yes, the cause is memory use patterns, but the price is steep nonetheless.
E.g.:
rate<-log(400*1.1^(1:30)) # runs about 27x times as fast as the following
(test via 'microbenchmark')
rate<-numeric(30)
for (i in 1:30){
rate[i]<-log(400*1.1^i)
}
When manipulating large arrays, the difference
This is not true. The steep price has to do with memory use patterns like
result <- c( result, new value ). Vectorization is cleaner, easier to read, and
somewhat faster, but for loops are not the monster that they have a reputation
for being if the memory is allocated before the loop and elemen
Also, any time you write "for" in R, you pay a steep price in performance. In
a short, simple loop it may not be noticeable, but in a more challenging
problem it can be a huge issue.
A more efficient way to write your loop would be:
infectrate = 400*1.1^(1:30) # calculation
cbind(1:30,log(infectra
The code has an error so it won't run as written.
Instead of:
infectrate[n]= (400)(1.1)^(n);
try:
infectrate[n]= 400*1.1^n;
What I get after making this change looks right.
--
View this message in context:
http://r.789695.n4.nabble.com/For-Loops-please-help-tp4711882p4711884.html
Sent from
I would to visualize in boxplot a data frame with two factors ordering one
factor with the median.
As example,suppose to have the InsectSprays dataframe, where an "operator"
factor with two levels, op1 and op2, has been added as shown at bottom here.
How may be generated a boxplot showing boxes fo
Great! Thank you
All the best
SF
Il 05/set/2015 15:08, "Marc Schwartz" ha scritto:
>
> > On Sep 5, 2015, at 7:29 AM, Sergio Fonda
> wrote:
> >
> > I would to visualize in boxplot a data frame with two factors ordering
> one
> > factor with the median.
> > As example,suppose to have the InsectSpr
> On Sep 5, 2015, at 7:29 AM, Sergio Fonda wrote:
>
> I would to visualize in boxplot a data frame with two factors ordering one
> factor with the median.
> As example,suppose to have the InsectSprays dataframe, where an "operator"
> factor with two levels, op1 and op2, has been added as shown a
Dear Joyaa,
> -Original Message-
> From: Joyaa Antares [mailto:jo...@goldcoastosteopathy.com.au]
> Sent: September 5, 2015 2:07 AM
> To: Fox, John
> Cc: r-help@r-project.org
> Subject: Re: [R] Unable to run RcmdrPlugin.survival using 3.2.2 with Windows
> 10
>
> Dear John,
>
> You menti
Hi Nick,
If you haven't just made a typo on your example in QUESTION 2, the "This
doesn't" line should read:
cronbach(jdc[,c("Q1","Q2","Q3")])
Without the quotes, R looks for three objects named Q1, Q2 and Q3 and
probably doesn't find them.
Jim
On Sat, Sep 5, 2015 at 7:27 AM, Nick Petschek
wr
23 matches
Mail list logo