similar to: sort a list?

Displaying 20 results from an estimated 10000 matches similar to: "sort a list?"

2008 Sep 22
4
sort a data matrix by all the values and keep the names
Dear all, If I have a data frame x<-data.frame(x1=c(1,7),x2=c(4,6),x3=c(8,2)): x1 x2 x3 1 4 8 7 6 2 I want to sort the whole data and get this: x1 1 x3 2 x2 4 x2 6 x1 7 x3 8 If I do sort(X), R reports: Error in order(list(x1 = c(1, 7), x2 = c(4, 6), x3 = c(8, 2)), decreasing = FALSE) : unimplemented type 'list' in 'orderVector1' The only way
2009 Jan 14
3
Partial sort?
This is definitely a newbie question but from the documentation I have not been able to figure out what the partial sort option on the sort method does. I have read and re-read the documentation and looked at the examples but for some reason it doesn't register. Would someone attempt to explain what sort with a non-null partial array of indices does? Thank you. Kevin
2008 Aug 02
2
Basic factor question.
Doing ?factor I get: x a vector of data, usually taking a small number of distinct values. levels an optional vector of the values that x might have taken. The default is the set of values taken by x, sorted into increasing order. So if I do: factor(letters[1:20],level=seq(1:20) [1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
2008 Jul 15
4
Iterations
I have a command that reads in some data: x <- read.csv("Sales2007.dat", header=TRUE) Then I try to organize the data: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Then I want to iterate through the data. I was able to get the following to run on the R console: for(i in 1:length(sc)) { sum(sc[[i]]$Quantity) } But notiing is primted on the console. I find
2008 Feb 21
2
Unable to create/index a zoo irregular timeseries
In the text file pressione2008.csv I have the following "Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" which is a collection of blood pressure data at different time of the day. I would
2020 May 18
2
order function called on a data.frame?
I guess we could make it do the equivalent of do.call(order, df). On Mon, May 18, 2020 at 8:32 AM Rui Barradas <ruipbarradas at sapo.pt> wrote: > > Hello, > > There is a result with lists? I am getting > > > order(list(letters, 1:26)) > #Error in order(list(letters, 1:26)) : > # unimplemented type 'list' in 'orderVector1' > >
2008 Nov 13
1
Error in Quantile function
If anyone can assist with this problem you have my great thanks: I am trying to establish and plot confidence intervals on a bootstrapped function. I have a more complicated function that has no problems with determining the confidence intervals using the quantile command. This is outside the bootstrap portion of the code that is working fine it is just determining everything for the more
2011 Oct 22
7
"Plotting" text?
I noticed that the text() command adds text to a plot. Is there a way to either make the plot blank or add text to a "blank sheet". I would like to "plot" a page that contains just text, no plot lines, labels, etc. Suggestions? Kevin [[alternative HTML version deleted]]
2006 Jun 27
1
order() (PR#9039)
Full_Name: Murray Smith Version: 2.2.1 OS: Windows XP Submission from: (NULL) (202.36.29.1) order() will not allow a complex vector for its first argument. This contrasts with sort() which will happily sort a complex vector. While this may not be regarded as a bug by some, it is annoying for anyone who makes frequent use of complex numbers. The problem occured in the Windows version 2.2.1 of
2008 Oct 10
2
Leap year?
Given a Date object or simply a year is there an R function to tell me if the it is a leap year or not? I was hoping for something like 'is.leapyear'. I probably can build my own function (year divisible by 4 etc.) but I would rather use an existing function if it is available. Thank you. Kevin
2008 Aug 28
6
Function not returning a vector?
Why does: (shape/scale) * (1:365/scale)^(shape - 1) return a vector of numbers but calling a function hasard(1:365,shape,scale) defined like: hazard <- function(x,shape,scale) { return (shape/scale) * (x/scale)^(shape - 1) } Only return a single value? It is like x becomes a single value passed as an argument. Thank you. Kevin
2010 Mar 22
2
Factors attribute?
I noticed that when I fit a linear model using 'lm' there is an attribute called "factors" that is added to the "term". It doesn't seem to appear for 'model.matrix', just 'lm'. I have been unable to find where it gets constructed or what it means? It looks like a two dimensional array that I may be able to use so I would just like to get some
2009 Jan 03
5
Power functions?
I had a question about the basic power functions in R. For example from the R console I enter: -1 ^ 2 [1] -1 but also -1^3 [1] -1 -0.1^2 [1] -0.01 Normally pow(-1, 2) return either -Infinity or NaN. Has R taken over the math functions? If so I would think that -1^2 is 1 not -1 and -0.1^2 is 0.01 not -0.01. Thank you. Kevin
2011 Nov 07
3
Upgrade R?
I am trying to upgrade to R 2.14 from R 2.13.1 I have compied all the libraries from the 'library' directory in my existing installation (2.13.1) to the installed R 2.14. Now I want to uninstall the old installation (R 2.13.1) and I get the error: Internal Error: Cannot find utCompiledCode record for this version of the uninstaller. Any ideas? Kevin [[alternative HTML
2009 Oct 28
5
PDF Corrupted?
I am running R 2.9.2 and creating a PDF that I am trying to open with Adobe Reader 9.2 but when I try to open it the reader responds with "There was an error opening this document. The file is damaged and cannot be repaired.: I am using the R command(s): pdf(file="cat.pdf", title="Historical Sales By Category") for(j in 1:length(master)) { d <-
2009 Mar 29
4
Constrined dependent optimization.
I have an optimization question that I was hoping to get some suggestions on how best to go about sovling it. I would think there is probably a package that addresses this problem. This is an ordering optimzation problem. Best to describe it with a simple example. Say I have 100 "bins" each with a ball in it numbered from 1 to 100. Each bin can only hold one ball. This optimization is
2008 Aug 03
2
Determining model parameters
This may be a begining question. If so, please bear with me. If I have some data that based on the historgram and other plots it "looks" like a beta distribution. Is there a function or functions within R to help me determine the model parameters for such a distirbution? Similarily for other "common" distirbutions, Poisson(lambda), Chi-Square(degrees of freedom, chi-square
2010 Jan 03
3
F77_CALL, F77_NAME definition
I give up. Maybe it is my search (Windows) but I cannot seem to find the definition of the F77_CALL or F77_NAME macros. Either there are too many matches or the search just doesn't find it. For example where is the source for: F77_CALL(dpotri) ? Thank you. Kevin
2009 Oct 27
3
Non-normal residuals.
Hello, I asked a question about what the most likely process to follow if after a time-series fit is performed the residuals are found to be non-normal. One peron responded and offered to help if I supplied a sample data set. Unfortunately now that I have a sample I have lost the emai addressl. If you are that person or have some ideas please email me back at rkevinburton at charter.net. Thank
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states: Return an array obtained from an input array by sweeping out a summary statistic. So what does it mean "weeping out a summary statistic"? Thank you. Kevin