Displaying 20 results from an estimated 500 matches similar to: "Getting ordered factor levels from C"
2012 Feb 28
1
group calculations with other columns for the ride
Hello,
I can get the median for each factor, but I'd like another column to go
with each factor. The nm column is a long name for the lvls column. So
unique work except for the order can get messed up.
Example:
x =
2011 Jan 26
1
aggregate(as.formula("some formula"), data, function) error when called from in a function
I'm having a problem with aggregate.formula when I call it in a function and the function is converted from a string in the funtion
I think my problem may also only occur when the left hand side of the formula is cbind(...)
Here is example code that generates a dataset and then the error.
The first function "agg2" fails
> agg2(FALSE)
do agg 2
Error in m[[2L]][[2L]] : object
2005 Jun 26
4
Mixed model
Hi All,
I am currently conducting a mixed model. I have 7 repeated measures on a
simulated clinical trial. If I understand the model correctly, the
outcome is the measure (as a factor) the predictors are clinical group
and trial (1-7). The fixed factors are the measure and group. The random
factors are the intercept and id and group.
I tried using 2 functions to calculate mixed effects.
2018 May 16
2
Bilateral matrix
xtabs does this automatically if your cross classifying variables are
factors with levels all the cities (sorted, if you like):
> x <- sample(letters[1:5],8, rep=TRUE)
> y <- sample(letters[1:5],8,rep=TRUE)
> xtabs(~ x + y)
y
x c d e
a 1 0 0
b 0 0 1
c 1 0 0
d 1 1 1
e 1 1 0
> lvls <- sort(union(x,y))
> x <- factor(x, levels = lvls)
> y <-
2004 May 13
5
code for functions in base package
Is there any way that I can see the step by step code for functions in
the base package? For instance the dexp function. I am a student
working on writing my own function for something that is similar to
this dexp function and I would like to see the step by step code.
Brittany Laine
GTA WVU Statistics Department
331 Hodges
2018 May 17
0
Bilateral matrix
Dear William and Ben,
Thank you for your replies and elegant solutions. I am having trouble with
the fact that two of the previous locations do not appear in current
locations (that is no one moved to OKC and Dallas from other cities), so
these two cities are not being included in the output.
I have provided a better sample of the data and the ideal output (wide form
- a 10x10 bilateral matrix)
2018 Apr 18
2
idmap_ad overlap with domain and sub-domain overlap
Hi Rowland,
Thanks for the help and ideally I would like to get rid of the sub domain
all together but that is probably not going to happen.
So couple comments and please forgive any of my ignorance.
For your second question, all users in the subdomain who have access to the
SAMBA server do have uidNumber set and it matches the uidNumber set in
MASTER. Since this is the case, would the
2008 Aug 05
5
boxplot with average instead of median
I really like the ease of use with the boxplot command in R. I would
rather have a boxplot that shows the average value and the standard
deviation then the median value and the quartiles.
Is there a way to do this?
Chad Junkermeier, Graduate Student
Dept. of Physics
West Virginia University
PO Box 6315
210 Hodges Hall
Morgantown WV 26506-6315
phone: (304) 293-3442 ext. 1430
fax: (304)
2007 Mar 27
18
Textile Editor Plugin v0.1
The Textile Editor Helper (TEH) is a Javascript-based text formatting
toolbar that will be added to all of your text areas that utilize the
TEH feature. TEH was developed to provide a more WYSIWYG-ish option
for users of our Rails CMS called slate while still letting us use
Textile.
======================
= So what are the features?
======================
These are a list of the current features
2004 Feb 05
0
correction to the previously asked question (about mergin g factors)
First of all, I do not understand why conversion to characters are not
allowed. That's what Sundar's solution is doing implicitly (but more
elegantly).
Here's a test of all three. See the function definitions below.
> f1 <- factor(sample(letters[1:3], 1e4, replace=TRUE))
> f2 <- factor(sample(letters[3:5], 1e4, replace=TRUE))
> f3 <- factor(sample(letters[5:7],
2004 Feb 05
2
correction to the previously asked question (about merging factors)
I have two factors l1, l2, and I'd like to merge them.
(Remark: The factors can not be converted to charaters)
Function c() does not give me the result I want:
> l1 = factor(c('aaaa', 'bbbb'))
> l2 = factor(c('ccc', 'dd'))
> lMerge = factor(c(l1, l2))
> lMerge
[1] 1 2 1 2
Levels: 1 2
>
I'd like to merge l1 and l2 and to get lMerge
2009 Sep 08
3
Mapping factors to a new set of factors
Hello,
I am trying to map a factor variable within a data frame to a new variable whose entries are derived from the content of the original variable and there are fewer factors in the new variable. That is, I'm trying to set up a surjection.
After first thinking that this would be a common operation and would have a quite simple interface, I can not seem to find one, nor any similar posts
2018 Apr 18
0
idmap_ad overlap with domain and sub-domain overlap
On Wed, 18 Apr 2018 10:52:12 -0400
Wvu Hpc <wvu.hpc at gmail.com> wrote:
> Hi Rowland,
>
> Thanks for the help and ideally I would like to get rid of the sub
> domain all together but that is probably not going to happen.
>
> So couple comments and please forgive any of my ignorance.
No problem.
>
> For your second question, all users in the subdomain who have
2005 Apr 13
1
R in Windows
Has anyone tried to create dialog boxes for Windows in R so that one
doesn't have to type in so much information but rather enter it in a
menu-based format. If not, does anyone plan on doing this in the future
if it's possible?
Thanks.
George (Kelley)
George A. Kelley, DA, FACSM
Professor & Director, Meta-Analytic Research Group
School of Medicine
Department of Community Medicine
2008 Sep 19
3
How to do knn regression?
Hello,
I want to do regression or missing value imputation by knn. I searched
r-help mailing list. This question was asked in 2005. ksmooth and loess
were recommended. But my case is different. I have many predictors (p>20)
and I really want try knn with a given k. ksmooth and loess use band width to define
neighborhood size. This contrasts to knn's variable band width via fixing
a
2011 Mar 14
3
ideas on sorting
Hi, I have a character vector as below:
a<-c('10','3R','4','4R','5','5R','6','6R','7','8','9','7R','1','10R','11'
2011 May 02
2
Lasso with Categorical Variables
Hi! This is my first time posting. I've read the general rules and
guidelines, but please bear with me if I make some fatal error in
posting. Anyway, I have a continuous response and 29 predictors made
up of continuous variables and nominal and ordinal categorical
variables. I'd like to do lasso on these, but I get an error. The way
I am using "lars" doesn't allow for the
2008 Sep 23
3
How to convert backslash to slash?
How to use sub, gsub, etc. to replace "\" in a string to "/"?
For example,convert "C:\foo\bar" to "C:/foo/bar".
Thanks,
Shengqiao Li
2013 Feb 08
2
Count of Histogram Bins using Shingles with lattice
I know that I can get a count of histogram bins in base R with plot=FALSE. However, I'd like to do the same thing with lattice. The problem is that I've set up shingles, and I'd like to get the count within each bin within each shingle. plot=FALSE doesn't seem to do it.
[[alternative HTML version deleted]]
2003 Jan 06
2
Is sftp-server's stdout redirected to client ?
Hello everyone,
I added some code to sftp, which would be useful for me. I add a
command "run", which can run any command on the remote shell, in the mean
time I want the server send the standard output back. for example, when I :
sftp> run ls
I want to see the result locally.
I thought the stdout of sftp-server has been redirected to the client. But
I get "message too