Displaying 20 results from an estimated 1000 matches similar to: "what does cut(data, breaks=n) actually do?"
2009 Sep 22
1
cut and re-factor data
Hello R-users,
I have a data frame with a factor of ages in 5 year increments, and various
count data for each age group. I only have this summary information in R at
the moment.
I want to create a new factor that aggregates the age factors if the
existing factors have insufficient counts. Then I can use aggregate to
build a new data set.
I figured out I can get the cut values I want using cut2
2013 Feb 01
2
Nested loop and output help
Hello Everyone,
My name is Thomas and I have been using R for one week. I recently found
your site and have been able to search the archives of posts. This has
given me some great information that has allowed me to craft an initial
design to an inquiry I would like to make into the breakdown of McNemar's
test. I have read an intro to R manual and the posting guides and hope I am
not violating
2012 Oct 17
2
loop of quartile groups
Greetings R users,
My goal is to generate quartile groups of each variable in my data set. I
would like each experiment to have its designated group added as a
subsequent column. I can accomplish this individually with the following
code:
brks <- with(data_variables,
cut2(var2, g=4))
#I don't want the actual numbers, I need a numbered group
data$test1=factor(brks,
2013 Apr 27
3
path reference problems in R 3.0.0
Hi-
I just upgraded R to 3.0.0 from 2.15.1 (which worked fine). When I started
trying to install updated versions of the libraries, I saw the following
error:
> install.packages("lme4")
Installing package into 'c:/Docume~1/melissa/R/win-library/3.0'
(as 'lib' is unspecified)
Warning in install.packages :
2011 Oct 11
1
warning with cut2 function
Dear r user,
please find my attached sample of the dataset i? am using to create a crosstable and eventually plot a histogram from the output.
I am using? the cut2 function to create bins, about 7 of them using the code after reading the data:
cluster <- cut2(cross_val$value, g=7)
I get the warning:
Warning message:
In min(xx[xx > upper]) : no non-missing arguments to min; returning Inf
2012 Oct 17
2
cut2 error
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However, when I
try and run the function on the following variable, I get an error message
(displayed below). I suspect it is because of the NA but I have no idea
how to address the error. Many thanks to any insights.
structure(list(var1 = c(97, 97, 98, 98, 97, 99, 97,
98, 99, 98, 99, 98, 98, 97, 97, 98, 99, 98,
2004 Jul 06
3
Improving effeciency - better table()?
Hi,
I've been running some simulations for a while and the performance of R
has been great. However, I've recently changed the code to perform a sort
of chi-square goodness-of-fit test. To get the observed values for each
cell I've been using table() - specifically I've been using cut2 from
Hmisc to divide up the range into a specified number of cells and then
using
2006 Feb 28
3
Agile Web Development Example Application Question
I''m new to Ruby and to fairly new to programming. I''ve been working
through the "Agile Web Development with Rails" book, and I''m stuck on page
73 of the print version. The book''s online errata directed me here with my
questions.
I''m running Ruby 1.8.3 with MySQL 4.1.8 on OSX 10.3.9. I''ve created the
scaffolding for Admin controller
2009 May 20
1
sem with categorical data
I am trying to run a confirmatory factor analysis using the SEM package. My
data are ordinal. I have read
http://socserv.mcmaster.ca/jfox/Misc/sem/SEM-paper.pdf.
When I apply the hetcor function, I receive the following error:
Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr,
:
at least one element of 'lower' is larger than 'upper'
Example:
2009 Oct 23
1
cut2 once, bin twice...
Hello,
I'm using the Hmisc cut2 function to bin a set of data. It produces bins
that I like with results like this:
[96,270]:171
[69, 96): 54
[49, 69): 40
[35, 49): 28
[28, 35): 14
[24, 28): 8
(Other) : 48
I would like to take a second set of data, and assign it to bins based on
factors defined by my call to cut 2.
Does anyone know how I can do this?
Thank you,
-S
--
View this message
2008 Oct 20
4
aggregating along bins and bin-quantiles
Dear all,
I would like to aggregate a data frame (consisting of 2 columns - one
for the bins, say factors, and one for the values) along bins and
quantiles within the bins.
I have tried
aggregate(data.frame$values, list(bin = data.frame
$bin,Quantile=cut2(data.frame$bin,g=10)),sum)
but then the quantiles apply to the population as a whole and not the
individual bins. Upon this
2010 Nov 29
3
Help Please!!!!!!!!!
Hi,
I have been working with Program R for my stats class and I keep coming upon
the same error, I have read so many sites about inputting data from a text
file into R and I'm using the data to do a correspondence analysis. I feel
like I have read everything and it is still not explaining why the error
message keeps coming up, I have used the exact examples I have seen in
articles and the
2012 Jan 28
2
finding rows in a matrix that match a vector
Hi,
Please excuse my ignorance, but I am just learning R (this is my very first
day programming in R) and having a really hard time figuring out how to do
the following:
I have a matrix that is 1000 row by 6 columns (named 'table.combos') and a 1
row by 6 column vector (named 'mine'). I want to find every row in
'table.combos' that equals 'mine' and then count
2010 Mar 08
1
Help with Hmisc, cut2, split and quantile
Hello,
I have a set of data with two columns: "Target" and "Actual". A
http://n4.nabble.com/file/n1584647/Sample_table.txt Sample_table.txt is
attached but the data looks like this:
Actual Target
-0.125 0.016124906
0.135 0.120799865
... ...
... ...
I want to be able to break the data into tables based on quantiles in the
"Target" column. I can see (using
2016 Sep 10
6
(Thin)LTO llvm build
I tried building llvm, clang, lld, lldb from the 3.9 svn release
branch with LTO, and some of the results were unexpected.
I first tried to rebuild llvm with llvm-3.9, which has ThinLTO, by
providing -DLLVM_ENABLE_LTO=Thin, but that failed very quickly, so I
fell back to building with -DLLVM_ENABLE_LTO=On and using the system
CC/CXX (gcc 6.1).
The resulting installed build is many times bigger
2009 May 13
2
converting numeric into character strings
Hi,
Im trying to put some numbers into a dataframe , I have a list of numbers
(change points in a time series) like such
[1] 2 11 12 20 21 98 99
but I want R to recognise this as just a character string so it will put it
in one row and column, ideally I want them seperated by commas so I would
have for example
Person Change points (seconds)
A
2003 Jan 10
5
Move existing Local Profile to Roaming
Hello:
I have a Redhat 7.3 samba server acting as a PDC and running samba
2.2.3a-13.
I have a few computers with extensive existing profiles and I want to know
if anyone knows of a good way to get the COMPLETE profile to the roaming
profile on the samba server. Every manual copy way that I have tried thus
far has failed miserably.
Thanks,
A Cline
2013 Jul 16
2
Importing data by odbcConnectExcel in 64 bit
I have probably an old question.
I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC
library does not work. Tried odbcConnectExcel2007 still does not work.
Any ideas.
Thanks
Melissa<-sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"),sqtable
= "Sheet3",
+ na.strings = "NA", as.is = TRUE)
Error in
2009 Apr 10
3
turning list into vector/dataframe
Hi,
I have used this command :
resamples<-lapply(1:1000,function(i) sample(lambs,replace=F))
resamples2<-lapply(resamples,Cusum)
to get a list of 1000 samples of my data. The function Cumsum is defined as
follows:
Cusum<-function(x){
SUM<-cumsum(x)-(1:length(x))*mean(x)
min<-min(cumsum(x)-(1:length(x))*mean(x))
max<-max(cumsum(x)-(1:length(x))*mean(x))
diff<-max-min
2012 Feb 22
2
rank with uniform count for each rank
Hello,
What is the best way to get ranks for a vector of values, limit the range
of rank values and create equal count in each group? I call this uniform
ranking...uniform count/number in each group.
Here is an example using three groups:
Say I have values:
x = c(3, 2, -3, 1, 0, 5, 10, 30, -1, 4)
names(x) = letters[1:10]
> x
a b c d e f g h i j
3 2 -3 1 0 5 10 30 -1 4
I