similar to: R interpreting numeric field as a boolean field

Displaying 20 results from an estimated 400000 matches similar to: "R interpreting numeric field as a boolean field"

2024 Jan 30
1
R interpreting numeric field as a boolean field
On 30/01/2024 11:10 a.m., Paul Bernal wrote: > Dear friends, > > Hope you are doing well. I am currently using R version 4.3.2, and I have a > .xlsx file that has 46 sheets on it. I basically combined all 46 sheets > and read them as a single dataframe in R using package rio. > > I read a solution using package readlx, as suggested in a StackOverflow > discussion as
2024 Jan 30
1
R interpreting numeric field as a boolean field
Dear friend Duncan, Thank you so much for your kind reply. Yes, that is exactly what is happening, there are a lot of NA values at the start, so R assumes that the field is of type boolean. The challenge that I am facing is that I want to read into R an Excel file that has many sheets (46 in this case) but I wanted to combine all 46 sheets into a single dataframe (since the columns are exactly
2024 Jan 30
1
R interpreting numeric field as a boolean field
If you are using the read_excel() function from the readxl package, then there's an argument named col_types that lets you specify the types to use. You could specify col_types = "numeric" to read all columns as numeric columns. If some columns are different types, you should specify a vector of type names, with one entry per column. Allowable names are "skip",
2024 Jan 30
1
R interpreting numeric field as a boolean field
Incidentally, "didn't work" is not very useful information. Please tell us exactly what error message or apparently aberrant result you received. Also, what do you get from: sapply(your_dataframe, "class") nrow(your_dataframe) (as I suspect what you think it is, isn't). Cheers, Bert On Tue, Jan 30, 2024 at 11:01?AM Bert Gunter <bgunter.4567 at gmail.com>
2024 Jan 30
1
R interpreting numeric field as a boolean field
Hi Bert, Below the information you asked me for: nrow(mydataset) [1] 2986276 ######## sapply(mydataset, "class") $`Transit Date` [1] "POSIXct" "POSIXt" $`Market Segment` [1] "character" $`N?mero de Tr?nsitos` [1] "numeric" $`Tar No` [1] "character" $`Beam Range (Operations)` [1] "character" $`Operational Vessel Ranges
2016 Apr 27
0
R Script Template
The subject of your email is missing. Perhaps you need to read the Posting Guide (again?) about attachments. Embedding your example directly in the body of the email is generally more accessible in archives than attaching it. -- Sent from my phone. Please excuse my brevity. On April 27, 2016 1:14:17 PM GMT+01:00, G.Maubach at gmx.de wrote: >Hi All, > >I am addressing this post to all
2016 Apr 27
2
R Script Template
Hi All, I am addressing this post to all who are new to R. When learing R in the last weeks I took some notes for myself to have code snippets ready for the data analysis process. I put these snippets together as a script template for future use. Almost all of the given command prototypes are tested. The template script contains snippets for best practices and leaves out the commands that
2024 May 03
1
Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?
It's exactly what I was looking for, thanks. I'm replying to the whole list so others can skip this question, to not waste time on it. Bonne fin de journ?e de Montr?al (nous sommes le matin ici) On Fri, May 3, 2024 at 10:30?AM Marc Girondot <marc_grt at yahoo.fr> wrote: > Is it what you want ? > mat_letters <- matrix(data=c('A', 'B', 'C',
2024 May 03
2
Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?
Is there a way to get a copy of a matrix only for TRUE entries of a matching size boolean matrix? For *example*: > mat_letters <- matrix(data=c('A', 'B', 'C', 'D'), ncol=2, byrow=TRUE) > mat_letters [,1] [,2] [1,] "A" "B" [2,] "C" "D" > mat_bools <- matrix(data=c(FALSE, TRUE, TRUE, FALSE), ncol=2,
2012 Feb 13
2
Deleting rows and columns containing NA's and "" only
Hello, I use read.xls from the gdata package to read in xlsx files. Sometimes these data.frames contain NA columns and rows only. I know how to get rid of those ones but here is the R output of a test data set read in with read.xls > t1 A B X D X.1 X.2 1 test 1 NA NA 2 <NA> asd NA
2010 Sep 19
1
help interpreting a model summary
Hello, I am all new here. Thanks for the job done, R really helped me in my thesis lately. However, I am kind of new in statistics, coming from mecanical engineering, and I mostly teached myself with "The R Book", so I may do silly things some time. PLease tell me if you think so. Anyway, I've just build up a piecewise linear model to fit some data, including some interaction and i
2018 Feb 24
3
Regression Tree Questions
Hi All, I'm a newbie and have two questions. Please pardon me if they are very basic. 1. I'm using a regression tree to predict the selling prices of 10 new records (homes). The following code is resulting in an error message: pred <- predict(model, newdata = outOfSample[, -6]) The error message is: Error in model.frame.default(Terms, newdata, na.action = na.action, xlev =
2023 Mar 31
1
Extraer texto de una columna en Excel
Muchas gracias Carlos, lo que quiero hacer es lo siguiente: extraer el texto que hay entre textura/s hasta el punto final. Ejemplo: *Moderadamente profundos, bien drenados, de textura franco arenosa a franco arcillo arenosa. Fertilidad natural media* Lo que quiero extraer sería: *franco arenosa a franco arcillo arenosa * Al final lo pude realizar de la siguiente manera: df <-
2023 Mar 31
1
Extraer texto de una columna en Excel
Muchas gracias por la alternativa de utilizar la librería stringi, Carlos, no la conocía. On Fri, 31 Mar 2023 at 12:11, David Camilo Gomez Medina < dcgomezme en unal.edu.co> wrote: > Muchas gracias Carlos, lo que quiero hacer es lo siguiente: extraer el > texto que hay entre textura/s hasta el punto final. > Ejemplo: > *Moderadamente profundos, bien drenados, de textura franco
2006 Apr 21
0
acts_as_list with the scope on boolean field
I have a boolean field in mysql (tinyint) which I want to use as a scope restriction for acts_as_list acts_as_list :scope => ''featured = #{featured}'' however, there is a problem here as when Rails generates SQL query for this it supplements true/false for #{featured} which raises error in mysql As a workaround I created dummy attributes that return 1/0 depending on featured
2002 Aug 21
1
is.numeric()
Dear R-list I am having troubles understanding how the function is.numeric() works. Any help appreciated. Some commands are given here (the output and my comments are given below) vec <- c(1.4, NA, NA, NA) sapply(vec,FUN=is.numeric) is.numeric(vec[2]) is.na(vec[2]) is.numeric(NA) vec <- c(TRUE, FALSE, NA, NA) sapply(vec,FUN=is.numeric) is.numeric(vec[2]) is.numeric(vec[3])
2006 Feb 28
6
How To Validate Boolean Form Field
Hello all. I''ve got the following in my model: class Individual < ActiveRecord::Base validates_presence_of :first_name, :last_name, :street, :city, :state, :zip validates_acceptance_of :AZ_resident, :message => "You must be an Arizona resident." end The AZ_resident field is present and defined as boolean (PostgreSQL 8.1), but validation will not occur.
2007 Feb 26
2
boolean db fields set to false fail validation with validates_presence_of?
I have a model that contains a :boolean field. In my view, I have a simple select of Yes or No, which equates to true or false, respectively. If I choose yes and save, everything works great. If I choose no, my model fails validation as I have this set as a required field using validates_presence_of. I have checked the log and it''s definitely set to false, why would this fail validation?
2006 Jul 18
1
updating boolean field in model from check box value
hello i am having a bit of trouble with updating the values of a boolean field in my database/model given the value returned by a check box i am generating the check box as follows: check_box("user", "enabled") which produces <input checked="checked" id="user_enabled" name="user[enabled]" type="checkbox" value="1"
2006 Apr 04
2
is.numeric (NA + NA) is TRUE, should be FALSE (PR#8745)
Full_Name: c fillekes Version: Version 2.2.1 (2005-12-20 r36812) OS: Gentoo Linux kernel 2.6.12 Submission from: (NULL) (129.116.71.233) "Not Available" is of course not a numeric: R > is.numeric (NA) [1] FALSE But for some reason, all arithmetic operations on NA's are in fact numeric, even if it's with other NA's. > is.numeric (NA+NA) [1] TRUE >