similar to: getting numeric arrays from data frame

Displaying 20 results from an estimated 30000 matches similar to: "getting numeric arrays from data frame"

2004 Feb 04
5
Newbie question: histogram
Hello, how do you create a histogram with a data frame? year snow.cover 1970 6.5 1971 12.0 1972 14.9 1973 10.0 1974 10.7 1975 7.9 ... mydata=data.frame(year=c(1970,...),snow.cover=c(6.5,...)) hist(mydata) does not work. Many thanks. PR
2004 Feb 05
2
Histograms by two factors
Hi I am trying to print out means, STDs and histograms under two sets of factors. I can manage it for one set - see below but not for two sets. That is, I want ot print out the mean STD and Histogram for each ITEM code within each DELIVERABLE code. In addition I can only get to view the histogram for the last item. How do you get R to stop overriding the histogram for eg level 1 for factor 1
2006 Aug 04
2
Doubt about Student t distribution simulation
Dear R list, I would like to illustrate the origin of the Student t distribution using R. So, if (sample.mean - pop.mean) / standard.error(sample.mean) has t distribution with (sample.size - 1) degree free, what is wrong with the simulation below? I think that the theoretical curve should agree with the relative frequencies of the t values calculated: #== begin options===== # parameters
2005 Apr 06
3
Error in hist.default(A) : `x' must be numeric
Dear everybody! I have load a list A of numbers and want a histogram to be drawn. on hist(Y) the Machine returns: Error in hist.default(A) : `x' must be numeric I found out, that the list is of type data.frame. Y<-as.numeric(Y) returns Error in as.double.default(A) : (list) object cannot be coerced to double What schould I do? Than you in advance!
2006 Feb 10
1
histogram error: 'x' must be numeric
Hi All, I have problem to plot histogram. What I did is: export a .csv file from PSQL database's table. so, inside this .csv file it looks like: 31.845 24.598 29.1223 24.715 23.1847 24.2321 25.2995 23.4261 30.7873 ...... Then, I use command: score<- read.csv('file.csv', header = FALSE,sep = ",") hist(score, main = "score") it gives error msg: Error in
2012 Nov 18
2
Question about making histogram and x must be numeric
Hello all, I hope someone of you can help me out, I have searched other posts as well but I can't find any solution to the problem I'm dealing with. I want to make a histogram from the data Telephone Lines MDGdataset <-read.csv("MDG_dataset_2010.csv", header=T) MDGdatasetAdapted <- subset(MDGdataset, select = c(Country_Code, Country_Name, Year,
2012 Apr 02
1
get data from Perl arrays
Hi, a very simple doubt, but I do not know how to manage this. I want to plot a histogram for all data in 'datos.txt'. a) by using R: datos<-scan("datos.txt") pdf("xh.pdf") hist(datos) dev.off() b) How could I invoke R inside Perl to do the same?? #!/usr/bin/perl open(DAT,"datos.txt"); while (<DAT>) { chomp; push(@datos,$_); } #now I want a
2005 Feb 16
3
Unable to create histograms
Hi, could someone pelase help me with this? My data set's name is db1(say) and one of the variables is var1. I gave the command: hist(db1$var1). The values of Var1 are numbers. I got an error which says: 'x' must be numeric. Sometimes it works for other datasets and it's not working for this dataset. Also, does R let us import data from an excel spreadhsheet? Thanks, Radha
2008 Mar 17
3
Creating plots for all variables in a data frame and printing them with the variable name in the main title
Dear all, I'm just trying to create plots for all variables in a dataframe (named "x") using the following: png() apply(x,2,hist) Just as intended, it produces one plot for each variable. Unfortunately, the main title of each graph is "Histogram of newX[,i]" instead of "Histogram of name of variable". This makes it impossible to assign the graphs to the
2006 Jan 21
1
" 'x' must be numeric"
Hello all, I am importing data from a txt file and try to get a histogram, I get the message: "Error in hist: 'x' must be numeric". When I use mode R returns "List". However when I use srt I get: `data.frame': 456 obs. of 1 variable: $ V1: num 0.6344 0.4516 0.0968 0.7634 0.7957 ... My file consists of one column only (no headers) and I can't figure out why
2010 Nov 08
3
how do i plot this "hist"?
Hi all, I have the following data in abc.dat ======================= 50 0 1 0 0 55 1 14 0 1 60 7 86 0 3 65 22 324 2 3 70 58 1035 1 7 75 30 2568 0 34 80 9 2936 15 162 85 27 2169 46 365 90 80 1439 212 432 95 236 1670 521 281 100 332 827 709 172 105 156 311 556
2003 Mar 19
3
How would I analyse data like this?
Hello, I'm a new R user and I'm having a little trouble getting started. I'm hoping someone can help me out. I have data that looks like this: phone|state|code|amount|left|channel|time|mtd 15555551234|3|983|1000|266|IN|2003-03-16 23:57:21-05|C 15555552345|3|983|3000|0|IN|2003-03-16 23:58:16-05|C 15555552346|3|983|1000|40|IN|2003-03-16 23:58:24-05|C Which I've read using scan().
2000 Dec 20
2
hyperlinks to other packages in .Rd files
Dear list members, I've been working on an R package, which I just checked and built with the new tools in the Windows version of R 1.2.0. (These tools are wonderful, by the way.) Everything went fine, except that cross-references that I tried to create to help pages in other packages don't work. Page 14 of Writing R Extensions says: "There are optional arguments specified as
2011 Aug 31
2
Getting the values out of histogram (lattice)
Hi, ? I have a relatively big dataset and I want to construct some histograms using the histogram function in lattice. One thing I am interested in is to look at differences between density and percent. I know I can use the hist function but it seems that this function gives sometimes some wrong answers and the density is actually a percent since it is calculated as counts in the bin divided by
2002 May 02
2
coercing "numeric" components of data frame to "factor" or "ordered"?
I am getting ready to load a bunch of data into R. The data is all numeric, but some of the numbers are integer codes representing non-numeric semantics. What is the best way to "fix" the data frames so that these compenents are recognized as "factors" or "ordered", as appropriate? Can I "assign" to some attribute of the data frame component, like the
2004 Dec 05
4
What is the most useful way to detect nonlinearity in logistic regression?
It is easy to spot response nonlinearity in normal linear models using plot(something.lm). However plot(something.glm) produces artifactual peculiarities since the diagnostic residuals are constrained by the fact that y can only take values 0 or 1. What do R users find most useful in checking the linearity assumption of logistic regression (i.e. log-odds =a+bx)? Patrick Foley patfoley at
2004 Jan 07
2
problem assigning an array to a variable in a data frame
Dear r-devel list members, Dirk Eddelbuettel brought the following problem to my attention. The code is abstracted from the appendix on mixed models from my R and S-PLUS Companion: > set.seed(12345) # for reproducibility > library(nlme) Loading required package: lattice > data(MathAchieve) > data(MathAchSchool) > attach(MathAchieve) > mses <- tapply(SES, School,
2004 Jul 20
1
Histogram without common borders
Is it possible to produce a histogram directly using the hist() function with the common borders removed? It can be done by plotting the histogram object using type 's'teps. my.hist <- hist(x,plot=FALSE) plot(my.hist$breaks,c(0,my.hist$counts),type='s') I would appreciate help Ross Darnell -- University of Queensland, Brisbane QLD 4067 AUSTRALIA Email: <r.darnell at
2007 Sep 17
3
Histogram with colors
Is there a simple way to plot a histogram with colors? For example, suppose I generate random points in the N(2,1) distribution: x <- rnorm(100000, mean = 2, sd = 1) Now I would like to plot the histogram: hist(x) but I would like to show the bars with x < 0 in red, and the bars with x >= 0 in lightgreen. Is there any simple way to do it? I think I can do it in two steps:
2005 Oct 18
2
hist of dates
Hi all I wish to draw an histogram... with dates but the following append, i don't know where is the problem, help(hist.Date) works and i don't see any usefull information on what i'm doing wrong... > hist.Date(dt_cycles) Error: couldn't find function "hist.Date" > hist.date(dt_cycles) Error: couldn't find function "hist.date" > cycles [1] 7 1