Displaying 20 results from an estimated 10000 matches similar to: "factor"
2004 Mar 22
5
Your email message was blocked
MailMarshal (an automated content monitoring gateway) has
not delivered the following message:
Message: B0000c89bd.00000001.mml
From: samba@samba.org
To: lianaj@balgrammar.vic.edu.au
Subject: Question
This is due to automatic rules that have determined that the
intended recipient is not authorized to receive messages with
certain potentially dangerous filetypes attached.
2009 Feb 10
7
How to split a character vector into 3 vectors
Hi ,
Does any one know how to split a character vector , I have a vector X that
looks like this and each row has 3 characters
X
ASK
DGH
ASG
AUJ
FRT
I would like to split the vector into 3 vectors that look like this
X1 X2 X3
A S K
D G H
A S G
A U J
U R T
thanks
--
View this message in context: http://www.nabble.com/How-to-split-a-character-vector-into-3-vectors-tp21939492p21939492.html
2009 Feb 10
7
ifelse()
I have a problem with ifelse(), I do not understand how it works.
> X<-c(2,2,1,1,0,0)
> str(X)
num [1:6] 2 2 1 1 0 0
> Y<-ifelse(X>0,1,0)
> Y
[1] 1 1 1 1 0 0
>
Can some one explain what is going on, I do not understand what ifelse is
doing in this case. Can someone explain the output Y.
Thanks
--
View this message in context:
2008 Jun 03
2
merge two data sets
I would like to merge ?data1 ?that contains 100 unique ID?s with another
data set ?data 2? with 150 ID?s and the age of those individuals ( the ID in
data1 is a subset of the ID in data 2) I would like to merge these data1
with data2 and have the result of the merge to have the ID ordered as in
data1.
Can this be done in R?
--
View this message in context:
2009 Dec 17
3
write.csv and col.names=F
Hi All,
I always have a problem with write.csv when I want the column names to be
ignored, when I specify col.names=F, I get a header of V1 V2 V3 V4 etc.
for example I tried
write.csv(mydata, file="data.csv", quote=FALSE, row.names=F, col.names=F)
Warning message:
In write.csv(mydata, file = "data.csv", quote = FALSE, :
attempt to set 'col.names' ignored
>
2010 Feb 26
6
using grep
Hi All,
I have a character vector with naems of cities in the us. I need to extract
the number that appear after the word "New York", for example,
x<-c("P Los Angeles44AZ", "P New York722AZ", "K New York20")
I want the results to be
722, 20
cab I use the grep function, if so how?
I appreciate your help, thanks,
--
View this message in context:
2010 Jul 29
3
help splitting a data frame
Hi All,
I have a dataset that I would like to split based on : or ? ( the data file
is tab delimited) for example:
Ny:23-45 AC
BA:88-91 DB
KJ:21-13 PA
And I would like the data to be splitted and the final results look like
NY 23 45 AC
BA 88 91 DB
KJ 21 13 PA
I would like to have the resulting data as a data frame so each column is a
variable.
Thanks,
--
View this message in context:
2009 Jan 07
3
breaking a loop in R
Hi All,
I was wondering if there is anything that breaks a loop in R. For example,
For (k in 1:100)
For ( i in 1:10){
If ( condition ){
Break the inner loop
}
}
}
In the above case, if the program runs the if statement, then I want the
inner loop for (i in 1:10) to stop looping and skip the rest of the program.
Thanks for your help
--
View this message in context:
2008 Nov 18
2
counting the number of elements in a column
Hi All,
I have a column that contains values between 0 and 1. I would like to make
a table that consists of the number of elements in each category.
For example , how many elements have values between 0 and 0.1, 0.1 to 0.2,
0.2 to 0.3,etc??..0.9 to 1.
Is there an easy way to do this?
Thanks
--
View this message in context:
2010 Jan 19
3
problem with the precision of numbers
Hi All,
I was wodering if it is possible to increase the precision using R. I ran
the script below in R and MAPLE and I got different results when k is large.
Any idea how to fix this problem? thanks for your help
for (k in 0:2000){
s=0
for(i in 0:k){
s=s+((-1)^i)*3456*(1+i*1/2000)^3000
}
}
--
View this message in context:
2010 May 06
2
Problem with install.packages(); getting out-of-date version.
I recently tried to install the latest version of spatstat, from CRAN,
using the install.packages() function. It proceeded to install version
1.17-5 of spatstat, although the current version is 1.18-4.
Checking the CRAN mirror that I used (New Zealand) via Firefox, I found
that version 1.18-4 is indeed present on CRAN. I was able to download
and install version 1.18-4 ``manually''
2010 Sep 16
8
function help?
Hi all,
I am writing a function (fun.R), but I dont know how to code the
function so that the Help Text will be shown up when one types ?fun (of
course, after he loads it up). Anyone has any advice for me how to do that?
Thanks,
D.
2009 Sep 05
2
Combining expressions.
I am trying to construct a function to which I pass an expression as an argument.
>From that expression I want to create a somewhat more complicated expression
and then differentiate it using D() or deriv().
To give a simple example, I'd like to be able to do something like
e1 <- expression(x^2 + y^2)
e2 <- some.magic(e1,"n")
or maybe e2 <- some.magic(e1,expression(n))
2009 May 27
2
problem with cbind
Hi All,
I have a file with two columns, the first column has the names of the
patients and the second column has the age. I am looking into creating an
output file that looks like
1-10 10-20 etc
Eric Chris
Bob mat
Andrew
Suzan
Where each column has the name of the patients in a given age category that
is displayed in the header. For example in the output, the first
2008 Apr 10
2
subtract the mean from each column
Hi,
I am new to R an dI need some help
I have a matrix of real values 100*300 and I would like to calculate the
mean for each column , then for each entry in a column i need to subtract
the mean so I will have a matrix where the columns have zero mean. any one
know how to do that . Thanks
--
View this message in context:
2008 Aug 27
1
How to create additional columns?
I do have some data of dim 100*3 (i.e 100 rows and 3 columns ) stored in a
txt file. I want to read the data into R, Perform the same operation in
each row and store the result in a forth column( that I should create).
I do not know how I can create a forth column to store the result of the
operation for each row?
--
View this message in context:
2009 Jan 21
3
filling blanks with NA
Hi,
I do have a data set with some missing values that appear as blanks. I want
to fill these blanks with an NA. How can this be done? Thanks for your help
--
View this message in context: http://www.nabble.com/filling-blanks-with-NA-tp21584278p21584278.html
Sent from the R help mailing list archive at Nabble.com.
2009 Oct 06
2
How to extract names from a vector
Hi All,
I have a character vector of length=700. The vector contains names and I
want to extract the names that contain the number 101. The number 101 could
be anywhere within the name.
what is the best way to do this?
--
View this message in context: http://www.nabble.com/How-to-extract-names-from-a-vector-tp25773482p25773482.html
Sent from the R help mailing list archive at Nabble.com.
2007 May 21
3
quartz() on MAC OSX
I am (desperately) trying to get used to using a Mac here at my new
location. (Why *anyone* would ever use anything other than Linux, except
under duress as I am, totally escapes me, but that's another story.)
Fortunately much of the Mac OSX is actually Unix, so a civilized person can
manage to carry on ... But there are some things. (Like this <expletive
deleted> mailer ... But
2009 Dec 18
1
Numerical Integration
Dear @ll. I have to calculate numerical integrals for triangular and trapezoidal figures. I know you can calculate the exactly, but I want to do it this way to learn how to proceed with more complicated shapes. The code I'm using is the following:
integrand<-function(x) {
print(x)
if(x<fx[1]) return(0)
if(x>=fx[1] && x<fx[2]) return((x-fx[1])/(fx[2]-fx[1]))