similar to: Counting a number of "elements" in an object

Displaying 20 results from an estimated 100 matches similar to: "Counting a number of "elements" in an object"

2010 Mar 25
3
Returning Data Frame from Function for use Outside Function
I have a function (see below) that does some bootstrapping (I am happy to expand offline why I could use existing functions.) I put my results into and empty matrix and add a row of results with each iteration. My problem is i am a new user to R and I don't understand data frames, matrices, elements, and vectors well. What I would like is to have a data frame I can manipulate outside of the
2012 Dec 03
2
Excluding all missing values with dcast ("reshape2" package)
Hello--I'm doing a simple crosstab using dcast: rawfreq <- dcast(nh11brfs, race3~CHCCOPD, length) with the results race3 Yes No NA 1 White non-Hispanic 446 5473 21 2 Other non-Hispanic 29 211 0 3 Hispanic 6 81 1 4 <NA> 10 83 1 How would I modify this call to exclude all missing values; that is, to obtain race3
2010 Jul 02
1
help with the xtable package
HI, Dear R community, I am using the xtable to create the table, but how can I see the table? The following is the codes I used: > data(tli) > tli.table <- xtable(tli[1:10, ]) > digits(tli.table)[c(2, 6)] <- 0 > print(tli.table, floating = FALSE) % latex table generated in R 2.11.0 by xtable 1.5-6 package % Thu Jul 1 20:43:43 2010 \begin{tabular}{rrlllr} \hline &
2009 Oct 31
1
Help me improving my code
Hi, I am new to R. My problem is with the ordered logistic model. Here is my question: Generate an order discrete variable using the variable wrwage1 = wages in first full calendar quarter after benefit application in the following way: * wage*1*Ordered *= 1 *if*0 *· wrwage*1 *< *1000 2 *if*1000 *· wrwage*1 *< *2000 3 *if*2000 *· wrwage*1 *< *3000 4 *if*3000 *· wrwage*1 *<
2007 Jul 03
1
Please help with legend command
Hi R-ers: I'm drawing a plot and have used different line types (lty) for different race/ethnicity groups. I want a legend that explains what line types correspond to the different race/ethnicity groups. I used the following code: legend( 1992 , 42 , c("Hispanic" , "non-Hispanic white (NHW)" , "non-Hispanic black" , "AI/AN" , "Asian" ) ,
2017 Jul 09
0
Help with ftable.svyby
try resetting your factor levels and re-run? q50 <- update( q50 , INCOME = factor( INCOME ) , AGECL = factor( AGECL ) , RACECL = factor( RACECL ) ) On Sun, Jul 9, 2017 at 2:59 PM, Orsola Costantini via R-help < r-help at r-project.org> wrote: > Hi all, > > When I try the following with pkg Survey it returns the error below: > > ftable(svyby(~INCOME, ~AGECL+RACECL,
2017 Jul 09
2
Help with ftable.svyby
Hi all, When I try the following with pkg Survey it returns the error below: ftable(svyby(~INCOME, ~AGECL+RACECL, svymean, design=q50), rownames=list(AGECL=c("<35", "35-44", "45-54", "55-64", "65-74", ">=75"), RACECL=c("white non hispanic", "non white or
2007 Oct 28
1
tree problem
I am trying to use tree to partition a data set. The data set has 3924 observations. Partitioning seems to work for small subsets of the data, but when I use the entire data set, no partitioning occurs. The variables are: RESP respondent to a survey (0 = not a respondent, 1 = respondent) AGE_P Age (continuous) ORIGIN_I Hispanic Ethnicity (1 = Hispanic, 2 = non-Hispanic) RACRECI2 Race
2008 Jan 07
1
recode() function results in logical output, not factor output
Dear R Users: I have race-ethnicity groups identified in the factor variable Ethnic_G. I need to collapse Ethnic_G into a new variable with only two factors, 1 (White, non-Hispanic) and 2 (Minority). As seen in the code and output below, the recoded race-ethnicity variable is put into logical format, not factor format. I've used library(car) and the package was updated. Any ideas on
2009 Jun 04
4
Binning or grouping data
Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I'm attempting to "group" or "bin" data together in order to analyze them as a combined group rather than as discrete set. I'll provide a simple example of the data for illustrative purposes. Patient ID | Charges | Age | Race 1 |
2009 Nov 09
2
Complicated For Loop (to me)
Hello, I'm trying to run a loop that will subset my data into specific sets by regions and by race/ethnicity. I'm trying to do this fairly compactly, and I cannot get this to work. A "simple" version of the code that I am trying to run is: names <- c("white", "black", "asian", "hispanic") for(j in names){ for(i in 1:9){
2002 Jul 15
0
Contact Needed... / http://www.samba.anu.edu.au
Let us submit http://www.samba.anu.edu.au for FREE on Japanese search engines, German search engines, Hispanic search engines , French search engines , Chinese search engines etc.....! After reviewing http://www.samba.anu.edu.au, we have noticed that your website cannot be found on foreign search engines. Could you please put me in touch with your marketing director or whoever is in charge of web
2011 Feb 01
1
dotchart {graphics} 2.11.1 vs. 2.12.1
I have a factor vector of subject races (Asian, Black, Hispanic, White; n=30) that I want to plot with a Cleveland dotplot or dotchart. I tried the following in R2.12.1 : > dotchart(table(school$Race)) Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type Using the same data set in R2.11.1 the operation succeeded (I tried several variations to be sure): >
2004 Oct 13
1
"Centered" dummy variables; non zero/one coding
I'm uncertain if this is perhaps a stupid question: I want to create "centered" dummy variables to use in a call to glm(), and wondering if there's some slick method in R to do so. That is, rather than have a factor, which results in a glm() fit returning coefficients specifying either absence or presence of the factor, I'd like to fit a glm() without intercept such that
2008 Sep 23
3
odds ratio: how to create reference
HI there, i know this is a basic question, though i need some help because this is somewhat away from my current issue, but nevertheless interesting to me... Lets assume i have some estimated probabilities, say estimated by a logit model. i know i can also state them as an odds ratio. Now i?d like to state these odds ratios as a reference to a specific outcome of my investigated
2008 Jul 31
1
Stuck on options_from_collection_for_select
Hi everyone, I''m stuck on something that seems to be super easy, but maybe I''m just too tired to see the obvious answer. I''m trying to make a drop down with select_tag and options_from_collection_for_select. I''m trying to fill this drop down list with different human races (white, black, hispanic, etc. in the database under the name field, with a unique id
2007 May 23
0
insatall CentOS 5 spanish
hi I am a Hispanic user I want to put in wiki of Centos my manual of installation of Centos 5 for spanish users pardon my English is very bad mi username is vladito An example of the manual can be seen here http://wiki.pinguinos.org/doku.php?id=flisol2007:guiacentos bye greetings to all -- Vladito Estamos aqui no por que seamos libres. ESTAMOS AQUI POR QUE QUEREMOS UN MUNDO LIBRE
2006 Jan 27
1
NUT public key?
I've successfully installed and configured NUT on my test machine and am moving it into production. http://www.networkupstools.org/source.html offers some good advice... "You should always use PGP/GPG to verify the signatures before using any source code" But where can I find the public key that was used to sign the source? It's not on any key servers I've been able to
2006 Jan 23
0
newbie: Slackware servers w/ AP9617, AP9606
I have a couple of Slackware servers which I have plugged into some APC UPS's. Each UPS has a network management card in it - one is the AP9617 and the other is the AP9606. I want the servers to shut themselves down when the UPS's go into "low battery" mode. What do I need to install? I've read this thread
2008 May 28
1
manipulating multiply imputed data sets
Hi folks, I have five imputed data sets and would like to apply the same recoding routines to each. I could do this sort of thing pretty easily in Stata using MIM, but I've decided to go cold turkey on other stats packages as a incentive for learning more about R. Most of the recoding is for nominal variables, like race, religion, urbanicity, and the like. So, for example, to recode race