On Sun, Aug 12, 2012 at 7:52 PM, R. Michael Weylandt
wrote:
> I am not sure if this is a general/fixed bias in the spearman
> estimator or if it's just a function of the covMat I randomly chose.
> Prof. Dalgaard and many others on this list must know.
To somewhat answer myself, I restricted my at
On Sat, Aug 11, 2012 at 5:53 AM, Anthony Damico wrote:
> Hi everyone, my apologies in advance if I'm overlooking something simple in
> this question. I am trying to use R's survey package to make a direct
> method age-adjustment to some complex survey data. I have played with
> postStratify, cal
Hi Erin,
The first element of the character vector is a string. You cannot
extract specifically characters from a string; try something like
?nchar
or perhaps better use regular expressions to extract things between
commas after two characters (or whatever logical rule accurately gets
the zip co
It's best if you make these things available to us using dput() in the future.
You're probably looking for the substr() function.
Since _strings_ (not characters) in R are "primitive" (Not in the
primitive/internal sense: just in the primordial sense) you can't
subset them with the brackets opera
hello,
i am trying to build R on alpine/gentoo with uclibc and it fails with the
following
error msg:
connections.c: In function 'Rconn_fgetc':
connections.c:3184:11: error: expected identifier before '(' token
connections.c:3186:15: error: expected identifier before '(' token
make[3]: *** [conn
Dear R People:
Here is a goofy question:
I want to extract the zip code from an address and here is my work so far:
> add1
results.formatted_address
"200 W Rosamond St, Houston, TX 77076, USA"
> add1[1][32:36]
NA NA NA NA NA
> str(add1)
Named chr "200 W Rosamond
On Sun, Aug 12, 2012 at 8:07 PM, Sachinthaka Abeywardana
wrote:
> The thing is I have about 10 cases. I saw the ifelse statement
Note that there is no "ifelse" statement: there is only nested if/else of forms
if
else if
else if
else
> but was
> wondering if
On Aug 12, 2012, at 5:43 PM, Sachinthaka Abeywardana wrote:
Hi all,
It seems like I cannot use normal 'if' for data frames. What would
be the
best way to do the following.
if data$col1='high'
data$col2='H'
else if data$col1='Neutral'
data$col2='N'
else if data$col='low'
data$col2='
Maybe the cut function?
?cut
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Pl
You might look at the 'recode' that is part of the 'car' package. You
can also setup a dataframe with two columns; one with the current
value and one with the new value you want, then you can use 'merge' or
'match' to create your new column. If you have provided some sample
data, I could have pro
> This whole discussion, of course, raises the (OT!) issue
>of the widespread misuse of linear modeling by those with insufficient
>background in linear algebra to understand the points S. Ellison
> discusses.
... but does not necessarily claim to comprehend. There's still Peter
Dalgaard's 'ortho
Hi,
Try this:
dat1<-data.frame(col1=c(rep("high",3),rep("Neutral",3),rep("low",4)))
dat1$col2<-ifelse(dat1$col1=="high",dat1$col2<-"H",ifelse(dat1$col1=="Neutral",dat1$col2<-"N","L"))
dat1
col1 col2
1 high H
2 high H
3 high H
4 Neutral N
5 Neutral N
6 Neutral
The thing is I have about 10 cases. I saw the ifelse statement but was
wondering if there was a cleaner method of doing it. The coding will get
really messy when I write all 10 cases.
Cheers,
Sachin
On Mon, Aug 13, 2012 at 11:04 AM, arun wrote:
> Hi,
> Try this:
> dat1<-data.frame(col1=c(rep("h
On Sun, Aug 12, 2012 at 1:46 PM, Boel Brynedal wrote:
> A clarification - yes, calculating the pearson covariance does give
> the expected results. I dont fully understand why yet, but many thanks
> for this help!
I'm not sure that the spearman correlation is an appropriate estimator
for the cova
Hi all,
It seems like I cannot use normal 'if' for data frames. What would be the
best way to do the following.
if data$col1='high'
data$col2='H'
else if data$col1='Neutral'
data$col2='N'
else if data$col='low'
data$col2='L'
else
#chuch a warning?
Note that col2 was not an existin
On 08/10/12 11:01, Cable, Sam B Civ USAF AFMC AFRL/RVBXI wrote:
> Duncan,
>
> I agree that my second code doesn't make sense. Sorry for the red herring.
> I was grasping at straws.
>
> My first code, however, differs from your suggestion only in that I am
> asking for a rectangular projection, A
check out the 'plotrix' package: floating.pie & pie.labels
On Sun, Aug 12, 2012 at 1:00 AM, Manish Gupta wrote:
> HI,
>
> I am plotting one pie chart and need to write % inside it. How can i write %
> inside it as show in figure below.
>
> http://r.789695.n4.nabble.com/file/n4640078/pie_chart.png
Hi R people.
Im currently trying to construct a piece of R-code that can retrieve a list
of webpages I have stored as a csv file and save the content of the
webpages into separate txt files. I want to retrieve a total number of 6000
threads posted at a forum, to try to build/train a classifier tha
This may work for your needs with a little fine tuning. Special and accented
characters can be represented in HTML with a character name or a numeric
value. For example, " can be represented as " or as " and it
appears from your example that both are used. I've attached a
dput(HTMLChars) to the end
Dirk Eddelbuettel writes:
> On 12 August 2012 at 07:56, Michael Weylandt wrote:
> | On Aug 12, 2012, at 6:09 AM, Thorsten Jolitz
> | wrote:
> | > Thorsten Jolitz writes:
> | > Let me reformulate my question (since I managed to make 'native' calls
> | > to C functions in libR by now):
> | > I s
A clarification - yes, calculating the pearson covariance does give
the expected results. I dont fully understand why yet, but many thanks
for this help!
2012/8/12 Boel Brynedal :
> Thanks for these replies.
> @Peter - are these methods only suitable for pearson covariances? That
> would def expla
On Aug 10, 2012, at 7:18 AM, toehanus wrote:
I am working on modifying a REDCap survey. The data dictionary
column for
the response field has the following value.
1, Strongly disagree | 2, Disagree | 3, Agree | 4, Strongly Agree |
5, Don't
Know | 6, Refuse to Answer | 7, Not Applicable
Thanks for these replies.
@Peter - are these methods only suitable for pearson covariances? That
would def explain my issues. Sorry for my ignorance, but I would
highly appreciate an explanation. My original covariance matrix is
calculated using spearman as well (which is suitable for the data).
@M
Hello,
Something like this?
x <- 1:5 # vector with more than one element
# warning, execution continues
if(x == 2) print(2) else print("No!")
ow <- options(warn = 2) # all warnings are now errors
# error, else clause not executed
if(x == 2) print(2) else print("No!")
options(ow) # reset defa
Hello,
I believe I don't understand your problem. Is this your input datum?
x <- "1, Strongly disagree | 2, Disagree | 3, Agree | 4, Strongly Agree
| 5, Don't Know | 6, Refuse to Answer | 7, Not Applicable"
If so the following will do it:
(search <- paste("(", 1:7, ",)", sep = ""))
(replace
On 11 August 2012 12:55, nobody wrote:
> hello,
>
> i am trying to build R on alpine/gentoo and it fails with the following
> error msg:
>
> connections.c: In function 'Rconn_fgetc':
> connections.c:3184:11: error: expected identifier before '(' token
> connections.c:3186:15: error: expected ident
On Aug 11, 2012, at 6:01 AM, Ista Zahn wrote:
On Sat, Aug 11, 2012 at 8:51 AM, Sachinthaka Abeywardana
wrote:
I should have mentioned that I do not know the number index of the
columns,
but regardless, thanks for the responses
Right, so use my first method. This does not depend on the pos
Hi Lee,
I've finally had time to look at this:
If you look at
?mlogit.data
you'll see that choice must be "the variable indicating the choice
made: it can be either a logical vector, a numerical vector with 0
where the alternative is not chosen, a factor with level 'yes' when
the alternative is
On 12 August 2012 at 07:56, Michael Weylandt wrote:
| On Aug 12, 2012, at 6:09 AM, Thorsten Jolitz wrote:
| > Thorsten Jolitz writes:
| > Let me reformulate my question (since I managed to make 'native' calls
| > to C functions in libR by now):
| > I still wonder whats 'in there' in libR - only
Dear All,i applied "NbClust", to my data to find optimum number of clusters,
and got following resultsNow, i don't know how to read these results. more
precisely, i would like to know, how to see which method is more precise for my
data considering these index values.your help is needed...thank
HI,
Your second function works:
fun2<-function(y){
if(y==2){
print("yes")}
else {print("no")}}
fun2(3)
#[1] "no"
fun2(4)
#[1] "no"
fun2(2)
#[1] "yes"
But, in the first case, it is a vector.
So, you can use:
fun3<-function(y){
numbers1<-c(4,5,9,11,17)
if(y %in% numbers1){
print("yes")}
Thanks!
Date: Sun, 12 Aug 2012 07:42:12 -0700
From: ml-node+s789695n4640093...@n4.nabble.com
To: stephen...@hotmail.com
Subject: RE: What's wrong with my code?
stephenxqy wrote
Yes, missing * is the problem. Thank you a lot. Do you mean I need to
incorporate all expression of Rg0sq,
HI,
Try ifelse
fun1<-function(y){
ifelse(y==c(4,5,9,11,17),"yes","no")
}
> fun1(9)
#[1] "no" "no" "yes" "no" "no"
A.K.
- Original Message -
From: Dominic Roye
To: r-help@r-project.org
Cc:
Sent: Sunday, August 12, 2012 6:12 AM
Subject: [R] Error in if-command
Hello everybody,
stephenxqy wrote
>
> Yes, missing * is the problem. Thank you a lot. Do you mean I need to
> incorporate all expression of Rg0sq, Rg etc. into the final Pfit function?
>
Not necessarily. For example in function Pexv you evaluate Rg(L,b) 5 times.
You can also do this evaluating Rg(L,b) once and
On Aug 12, 2012, at 6:09 AM, Thorsten Jolitz wrote:
> Thorsten Jolitz writes:
>
> Let me reformulate my question (since I managed to make 'native' calls
> to C functions in libR by now):
> I still wonder whats 'in there' in libR - only the core C functions, or
> all the functions written in
Take a look at ?ifelse
Cheers,
Michael
On Aug 12, 2012, at 3:12 AM, Dominic Roye wrote:
> Hello everybody,
>
> I don't understand what I'm doing wrong. But it isn't possible that each
> element of the if-condition is tested for each vector element?
>
> y <- c(1:20)
>> y
> [1] 1 2 3 4 5
Another helfpul function is strptime
Berry
--
View this message in context:
http://r.789695.n4.nabble.com/Changing-character-into-date-tp4640079p4640088.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing l
Yes, missing * is the problem. Thank you a lot. Do you mean I need to
incorporate all expression of Rg0sq, Rg etc. into the final Pfit function?
Qiuyang
Date: Sat, 11 Aug 2012 21:18:03 -0700
From: ml-node+s789695n4640077...@n4.nabble.com
To: stephen...@hotmail.com
Subject: Re: What's wrong wit
Thorsten Jolitz writes:
Let me reformulate my question (since I managed to make 'native' calls
to C functions in libR by now):
I still wonder whats 'in there' in libR - only the core C functions, or
all the functions written in R itself too? And what packages are included?
--
cheers,
Thorsten
Hello everybody,
I don't understand what I'm doing wrong. But it isn't possible that each
element of the if-condition is tested for each vector element?
y <- c(1:20)
> y
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
> if (y == c(4,5,9,11,17)) { print("yes") } else { print("no
On Aug 11, 2012, at 16:17 , Boel Brynedal wrote:
> cov8=cov(sample8,method='spearman')
There's your problem. I'm surprised that nobody seems to have picked up on
this, but Spearman covariances are of the ranks, not of the data. Try
method="pearson".
--
Peter Dalgaard, Professor,
Center for S
At 15:17 11/08/2012, Boel Brynedal wrote:
Hi,
I want to simulate a data set with similar covariance structure as my
observed data, and have calculated a covariance matrix (dimensions
8368*8368). So far I've tried two approaches to simulating data:
rmvnorm from the mvtnorm package, and by using t
Hi!
I just discovered that cutree() and cut.dendrogram() do not assign the
same cluster numberings when called on the same tree. More specifically,
cutree() assigns cluster numbers by order of appearance in the data,
while cut.dendrogram() sorts clusters by height (see example below). I
guess this
Hello,
There are two or three simple ways.
x <- c("2012-08-09 22:23:00", "2012-08-09 22:24:00")
#1st: dates without times
as.Date(x)
[1] "2012-08-09" "2012-08-09"
#2nd: dates and times and time zones.
#Too big for axis tick marks?
as.POSIXct(x)
[1] "2012-08-09 22:23:00 BST" "2012-08-09 22:2
On 12.08.2012 04:54, Ashok Parmar wrote:
hello everyone,
i am getting problems in graph plotting. When i attach file after adding
color attributes in my data set. i got problem of "GlobalEnv" and masked
the followings. Like this
attach(machm)
The following object(s) are masked _by_ '.Global
Post yer code and I'd be happy to take a look.
On Aug 11, 2012 10:57 PM, "Manish Gupta" wrote:
> HI,
>
> I am plotting one pie chart and need to write % inside it. How can i write
> %
> inside it as show in figure below.
>
> http://r.789695.n4.nabble.com/file/n4640078/pie_chart.png
>
> Regards
>
46 matches
Mail list logo